Replace casting in GetQueryPredicate with as operator
asvishnyakov opened this issue · 0 comments
asvishnyakov commented
This code will fail with
Unable to cast the type 'VirtoCommerce.CustomerModule.Data.Model.MemberDataEntity' to type 'VirtoCommerce.CustomerModule.Data.Model.ContactDataEntity'. LINQ to Entities only supports casting EDM primitive or enumeration types
exception because Entity Framework can cast only objects with primitive C# types.
With as
operator all is well.
Currently we has not issue with that because indexed search will always be used if SearchPhrase specified.