Get max & min from Entity Framework, in one query and with best query possible

前端 未结 2 1589
你的背包
你的背包 2021-01-17 11:37

I\'m aware of this question, but what I would like to do is obtain something close to this generated SQL:

select MAX(C         


        
2条回答
  •  粉色の甜心
    2021-01-17 12:25

    var query = from d in db.Table
                where d.Id == 1
                select
                {     
                    d.Max(t =>t.yourColName),  
                    d.Min(t =>t.yourColName)  
                };
    

提交回复
热议问题