永久免费看黄A片无码软件,japanese 在线观看国产,强奷高H猛烈失禁潮喷播放,亚洲成精品自拍

rexian

咨詢電話:023-6276-4481

熱門文章

聯(lián)系方式

電 話:023-6276-4481

郵箱:broiling@qq.com

地址:重慶市南岸區(qū)亞太商谷6幢25-2

當(dāng)前位置:網(wǎng)站首頁 > 技術(shù)文章 > c# GroupBy的動(dòng)態(tài)拼接

c# GroupBy的動(dòng)態(tài)拼接

編輯:pansiqin 發(fā)表時(shí)間:2017-12-04 14:00:30
pansiqin

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));
}