我正在尝试将以下sql查询转换为linq。运行sql查询需要一秒钟,但linq返回结果需要大约10秒。谁能告诉我怎样才能减少linq查询的时间?select datediff(mm, min(QueuedTime), max(QueuedTime)), SequencingQueue group by SequencingQueue
order by datediff(mm, min(QueuedTime),
DateDiff(string, DateTime?, DateTime?)'on the type 'System.Data.Objects.SqlClient.SqlFunctions' cannot be translated into a LINQ to Entitiesstore expression的System.NotSupportedException,尽管DateDiff有EdmFunction属性?context.Users.Where(f => System.Dat
我目前正在处理一个日期比较页面,我的一个同事给出了一个SQL查询,我需要在Linq上进行转换。但是我不太熟悉SQL语言中的DATEDIFF 下面是SQL查询 ,case when DATEDIFF(day, isnull(a.NewWorkerDate,a.Workerdate), a.Workerdate)=0 then 'NEWWORKER' ELSE 'OLDWORKER' End as WorkerType 我尝试了这样的方法,但得到了不