public class Person
{
public string FirstName{set;get;}
public string LastName{set;get;}
public Person(){}
public Person(string firstName, string lastName)
{
FirstName = firstName;
LastName = lastName;
}
}
List<Person> personList=new List<Person>();
personList.Add(new Person() { FirstName = "Mickey", LastName = "Mouse" });
personList.Add(new Person() { FirstName = "Mickey", LastName = "Mouse" });
personList.Add(new Person() { FirstName = "zhang", LastName = "san" });
string columnName="FirstName";
var dics=personList.GroupBy(x => GetPropertyValue(x, columnName)).ToDictionary(x=>x.Key,x=>x.Count());
foreach(var dic in dics)
{
textBox1.AppendText(string.Format("{0},{1}\r\n",dic.Key,dic.Value));
}
//根据子项目id得到flowjump实体类
flowJumps = this.FlowJumps;
//按工序groupby flowjumps
IEnumerable<IGrouping<int, FlowJump>> query =
flowJumps.GroupBy(pet => pet.processID, pet => pet);
foreach (IGrouping<int, FlowJump> info in query)
{
List<FlowJump> sl = info.ToList<FlowJump>();//分组后的集合
//也可循环得到分组后,集合中的对象,你可以用info.Key去控制
//foreach (FlowJump set in info)
//{
//}
}
var groupInfo = orderinfo.Info.GroupBy(m => m.xx).ToList();
foreach (var item in groupInfo)
{
string infotemp = item.Key;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有