IEnumerable<IGrouping<string, ChronicIcd>> query = chronicList.GroupBy(pet => pet.ChronicName);
                    if (query != null)
                    {
                        result = new List<List<ChronicIcd>>();
                        foreach (IGrouping<string, ChronicIcd> info in query)
                        {
                            List<ChronicIcd> sl = info.ToList<ChronicIcd>();//分组后的集合  
                            result.Add(sl);
                        }
                    }

 

mark一下

对list集合进行分组

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-25
  • 2022-12-23
  • 2021-09-21
  • 2022-12-23
  • 2021-09-25
相关资源
相似解决方案