Skip to content

IEnhancedUserType from string to bool fails in some circumstances #2704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pasqualedante opened this issue Mar 16, 2021 · 1 comment · Fixed by #2705
Closed

IEnhancedUserType from string to bool fails in some circumstances #2704

pasqualedante opened this issue Mar 16, 2021 · 1 comment · Fixed by #2705

Comments

@pasqualedante
Copy link

I have a custom mapping type that transform a string (N or S) from database to a bool on the entity side.
This custom mapping type works fine in NH 5.2.x. After the migration to NH 5.3.x the custom mapping type works well except in one scenario: when the query check the inverse value of one variable, as show under:

var no = false;
Assert.IsTrue(_database.GetSession().Query<Entity1>().Where(x => x.IsChiusa == !no).Any());

I attach here a unit test to show the issue in action.

Thanks,
Pasquale.

issue_in_action.zip

@bahusoid bahusoid linked a pull request Mar 17, 2021 that will close this issue
@fredericDelaporte fredericDelaporte added this to the 5.3.7 milestone Mar 17, 2021
@fredericDelaporte fredericDelaporte changed the title IEnhancedUserType from string to bool fails in some circumstance in NH 5.3.x (regression) IEnhancedUserType from string to bool fails in some circumstances Mar 20, 2021
@fredericDelaporte
Copy link
Member

Fixed by #2705.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants