-
Notifications
You must be signed in to change notification settings - Fork 934
Fail to cast enum as nvarchar for Linq Contains #2453
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
Comments
I think it's the same bug related to #2439 but not solved completely |
I am unable to reproduce the issue, I have tried the following query: var filter = new
{
Enums = new[] { EnumStoredAsString.Large }
};
var query = db.Users.Where(o => filter.Enums.Contains(o.Enum1)).ToList(); and it works fine. Does your |
Hello,
query is a simple |
Here is the failing test you can add to EnumTests under Linq folder:
NHibernate.Exceptions.GenericADOException |
Thanks, I unintentionally tested the query on mysql where the issue does not occur. Made a fix in #2459. |
Thank you @maca88. Do you think there will be a 5.3.2 soon? |
Fixed by #2459. |
Thank you @fredericDelaporte |
Hello,
System.Data.SqlClient.SqlException (0x80131904): Conversion failed when converting the nvarchar value 'cash' to data type int.
is still thrown when using Contains method. for example:
query.Where(x => filter.PaymentMethods.Contains(x.PaymentMethod));
where payment method is mapped on db as a string (default):
fluentnhibernate ->
Map(x => x.PaymentMethod).Not.Nullable();
thank you
ps. this happens after upgrading from 5.2.7 to 5.3.1, No code changed. I had to rollback to previous version
The text was updated successfully, but these errors were encountered: