C# Linq or Lambda expression Group by Week IEnumerable list with date field

后端 未结 6 1442
梦如初夏
梦如初夏 2021-01-01 04:53

I am trying to do a query to an IEnumerable to group by week, for example:

Project(Name, DateStart,ID)

I have

6条回答
  •  醉话见心
    2021-01-01 05:08

    I think to simplify this task you can add WeekNumber property into Project class and fill it when you are creating object of Project after you can easy group by WeekNumber property

    Project(Name, DateStart,ID,WeekNumber)
    

提交回复
热议问题