拼接筛选条件
// 拼接条件 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();