标签:简单 group by func var tar epo rod list mes
拼接筛选条件
// 拼接条件 Expression<Func<ProductLangDailySummaryDetail, bool>> whereCondition = p => 1 == 1; if (dateTimeStart != null) whereCondition = whereCondition.And(m => m.SummaryDate >= dateTimeStart); if (dateTimeEnd != null) whereCondition = whereCondition.And(m => m.SummaryDate <= dateTimeEnd);
通过ProductType和Language分组,得到分组后的对象列表
var ProductLangDailySummaryDetailGroup = _productLangDailySummaryDetailRepository.Query().Where(whereCondition).GroupBy(x => new { x.ProductType, x.Language }).Select(m => new { ProductType = m.Key.ProductType, Language = m.Key.Language, Count = m.Count() }).ToList();
标签:简单 group by func var tar epo rod list mes
原文地址:https://www.cnblogs.com/KQNLL/p/10117088.html