I have got a method which contains a call to EF.Functions.Contains
. Now I want to write unit tests for this method with a InMemory database, but I am getting instantly the following exception System.InvalidOperationException : The 'Contains' method is not supported because the query has switched to client-evaluation.
My method looks like this
var attributeValues = Context.AssetAttributeValues
.Include(a => a.AssetAttribute)
.Include(a => a.Asset)
.Where(i => EF.Functions.Contains(i.Value, searchString));
I know that this exception is thrown because I have got no fulltext index on my InMemory database compared to my productive SQL Server instance but how do I get the same index on the InMemory database?
Is there any way to get arround this exception?
.Where(i => i.Value.Contains(searchString));
– PridemoreLIKE '%searchstring%'
operation which is definitly not fast... – Slalom