I have code like this:
context.myTable.Where(x => x.myByteArray.Contains(myString)).Load();
It's not working because byte array does not have "Contains" definition. So I want to do something like this:
context.myTable.Where(x => Encoding.Default.GetString(x.myByteArray).Contains(myString));
This also didn't work because of exception:
LINQ to Entities does not recognize the method 'System.String GetString(Byte[])' method, and this method cannot be translated into a store expression.
How could I search string in my byte array then using Linq-to-Entities?
SqlFunctions.CharIndex.varchar(max)). Try to build a sql equivalent query of what you try to do with EF... if you can't do it, then EF will probably fail too.