I get an error when I try to run the following query in LINQ to Entities:
var query = DBConn.myView
.Select(dm => new App.DTOs.MyDTO
{
ID = dm.ID,
Prop1 = dm.Prop1
....
})
.Where(dm => dm.TypeID != 4);
The Error message is:
LINQ expression node type 'TypeID' is not supported in LINQ to Entities
It fails on the .ToList()
call:
private List<MyDTO> lstDTO;
lstDTO = query.ToList();
However, if I remove the .Where()
from the query, it works. Is there any way to use the Where
clause with this query?