Skip to content

IEnhancedUserType from string to bool fails in some circumstances #2704

Closed
@pasqualedante

Description

@pasqualedante

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions