一、聚合函数查询
double sum = 0; using (xxxEntities db = new xxxEntities()) { sum = db.userinfo.AsNoTracking().Where(d => d.id==id).Sum(m => (double?)m.money).GetValueOrDefault(); } return sum;
时间: 2024-10-31 09:30:56
一、聚合函数查询
double sum = 0; using (xxxEntities db = new xxxEntities()) { sum = db.userinfo.AsNoTracking().Where(d => d.id==id).Sum(m => (double?)m.money).GetValueOrDefault(); } return sum;