Is it possible to compare a byte array in the where clause using Entity Framework?
I've got a list of bytes like this:
List<byte[]> VisitorIDList
I need to pull some data like this:
var VisitorList = context.Visitors
.Where(a => VisitorIDList.Contains(a.VisitorID))
.ToList();
The VisitorID field is interpreted as a byte[] by EF. I can't use the SequenceEqual() method as that doesn't translate to SQL and Contains won't match the records. So am I just SOL on using EF for this?
I know I could do something like this:
var VisitorList = context.Visitors
.ToList()
.Where(a => VisitorIDList.Any(b => b.SequenceEqual(a.VisitorID)))
.ToList();
But obviously that is not practical. I'm using C#, .NET 4.5 and EF 6.
