Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework 'ArrayIndex' is not supported in LINQ to Entities

in my SQL Server DB table, I have the binary column type.

I can't execute the query, why ?

var data = (from x in model.MyTable
            where x.BinaryColumn[0] == 1
            select x).FirstOrDefault();

I get the The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities error

like image 442
Tony Avatar asked May 11 '15 17:05

Tony


1 Answers

These expressions are translated to SQL queries, and this is one of the things you cant do. Take a look here for more detail: LINQ To Entities doesn't recognize array index

like image 113
Jon Koivula Avatar answered Oct 19 '22 08:10

Jon Koivula