You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeHandler seems to work everywhere but when I try to use ItemGroupId in IN clause like this sqb.Where("EXISTS (SELECT * FROM ItemForItemGroup WHERE ItemGroupId IN @ItemGroupIds AND ItemId = item.Id)", new { ItemGroupIds = sOptions.ItemGroupIds.ToList() });
I get error System.ArgumentException : No mapping exists from object type Removed.ItemGroupId to a known managed provider native type.
I had to change it to sqb.Where("EXISTS (SELECT * FROM ItemForItemGroup WHERE ItemGroupId IN @ItemGroupIds AND ItemId = item.Id)", new { ItemGroupIds = sOptions.ItemGroupIds.Select(x => (int)x).ToList() }); to make it work.
The text was updated successfully, but these errors were encountered:
I'm using Dapper v1.50.5 from NuGet and I have this struct
and this TypeHandler
TypeHandler seems to work everywhere but when I try to use ItemGroupId in IN clause like this
sqb.Where("EXISTS (SELECT * FROM ItemForItemGroup WHERE ItemGroupId IN @ItemGroupIds AND ItemId = item.Id)", new { ItemGroupIds = sOptions.ItemGroupIds.ToList() });
I get error
System.ArgumentException : No mapping exists from object type Removed.ItemGroupId to a known managed provider native type.
I had to change it to
sqb.Where("EXISTS (SELECT * FROM ItemForItemGroup WHERE ItemGroupId IN @ItemGroupIds AND ItemId = item.Id)", new { ItemGroupIds = sOptions.ItemGroupIds.Select(x => (int)x).ToList() });
to make it work.The text was updated successfully, but these errors were encountered: