The number of values in the statistical list appears returned dictionary

/// <summary>
the number of repeating data array /// statistics appearing
/// </ Summary>
/// <Returns> </ Returns>
Private the Dictionary <int, int> GetListInfo (List <int> IDS )
{
the Dictionary <int, int> DIC =
new new the Dictionary <int, int> ();

var lst = from v in ids
group v by v into G
orderby G.Key
select new
{
data = G.Key,
count = G.Count()
};
foreach (var v in lst)
{
dic.Add(v.data, v.count);
}
return dic;
}

Guess you like

Origin www.cnblogs.com/request/p/12059811.html
Recommended