c# - Linq query group by distinct -


i have linq query complete. it's working need retrieve original list of items in list full fills reiquirements.

now returns true or false if has count > numberofresourcetobook.

but instead want return items in avaialbetimes having (with it's properties).

please help!

bool enoughresourceavailable = availabletimes.groupby(l => new { l.from, l.to })   .select(g => new   {       date = g.key,       count = g.select(l => l.resourceid).distinct().count()   }).where(c => c.count  >= numberofresourcestobook).count() > 0; 


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -