How to do a Sum using Dynamic LINQ

后端 未结 4 537
暗喜
暗喜 2021-01-11 23:13

I have the following which works brilliantly with the dynamic linq library:

string where = \"Price < 5\";
string orderby = \"BookID ASC\";
IQueryable

        
4条回答
  •  时光说笑
    2021-01-12 00:14

    Try using a lambda expression:

    double mysum = MyDataQueryable.Sum(mdq => mdq.Price); 
    

提交回复
热议问题