LINQ + EntityFunctions in asp.net mvc

后端 未结 2 1087
陌清茗
陌清茗 2020-12-21 13:52

I have such code using EntityFramework Alpha3 (from nuget):

class Member
{
    [Key]
    public int Key { get; set; }
    public string Forename { get; set;         


        
2条回答
  •  眼角桃花
    2020-12-21 14:29

    The reason why you're getting this error is that by design Linq to Entities converts all expression to server query. So it does not know how to translate DiffDays to SQL. Try to omit this method and rewrite expression.


    UPDATE:

    EntityFunctions are Canonical functions so you can use them in Linq to Entities. So the only reasonable explanation is in EF Alhpa version.

提交回复
热议问题