EF 4: The specified type member '*' is not supported in LINQ to Entities

前端 未结 2 699
被撕碎了的回忆
被撕碎了的回忆 2021-01-21 08:58

i have a mapped-class like this:

[Table(\"MyTable\")]
class MyClass         
{   
        //properties; id, name, etc...

        private string _queuedToWHTime          


        
2条回答
  •  天命终不由人
    2021-01-21 09:39

    You cannot query with EF on custom properties. The custom property cannot be translated in SQL.

    You can do this to force the orderby to be done 'in-memory'.

    var searchRslt = queryableNews
        .AsEnumerable()
        .OrderBy(m => m.QueuedToWHTime_DateTime)
        .ToList();
    

提交回复
热议问题