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
Post a Comment