Question

I have a List that contains data from various dates. I would like to create a sub list of data that only contains information from a certain interval such as today all the way back to 6 months ago.

var results = Bean.GroupBy(dc => new {dc.serviceType, dc.periodType}).Select( WHAT GOES HERE?)

period is the name of the interval of time in my list

I want something like: period between Date1 and Date2

Thanks

Was it helpful?

Solution

What about:

var results = Bean.Where(x => x.period > Date1 && x.period < Date2).GroupBy(dc => new {dc.serviceType, dc.periodType})

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top