Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个简单List的客户记录:
List
Customer Name Age DateTimeOfThing
使用 Linq,我需要知道每天有多少客户,什么时候DateTimeOfThing是DateTime.
DateTimeOfThing
DateTime
像这样的东西:
1-April-2013 23 2-April-2013 3 3-April-2013 123
我的来源是这样的:
var myList = new List<Customer>() ....
var res = myList .GroupBy(z => z.DateTimeOfThing.Date) .Select(z => new { Count = z.Count(), Date = z.Key });