人本善良

导航

随笔分类 -  linq

linq distinct扩展
摘要:public static IEnumerable<TSource> DistinctBy<TSource, TKey> (this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) { HashSet<TKey> seenK 阅读全文

posted @ 2021-08-04 11:44 简简单单2018 阅读(55) 评论(0) 推荐(0)

linq group by
摘要:var linqResult = from c in Result.AsEnumerable() group c by new { a = c.site_address_apartment, b = c.deli_dt } into s select new CommunityAnalysisVO 阅读全文

posted @ 2019-02-25 17:10 简简单单2018 阅读(361) 评论(0) 推荐(0)

linq partion by 用法
摘要:var PartinoByList = list.OrderBy(x => x.DateType).GroupBy(x => new { x.ProductCatagoryId, x.SupplierName, x.ChannelName }) .Select(g => new { g, count 阅读全文

posted @ 2018-10-25 10:56 简简单单2018 阅读(547) 评论(0) 推荐(0)

Linq/EF/lambda Group by/Order by 多个字段详细用法
摘要:Linq/EF/lambda Group by/Order by 多个字段详细用法 1)单个字段Group by: //a.Key类型与a.Province字段类型一样 1 .GroupBy(a => a.Province).Select(a => a.Key).ToList(); 2)多个字段Gr 阅读全文

posted @ 2018-10-25 10:41 简简单单2018 阅读(368) 评论(0) 推荐(0)