I’m trying to find a way to group records by date (not taking into account time) using the LINQ method syntax but only select one instance of each record (which is ItemId within the model)
My simple query is as follows:
range1.Count(x => ((x.OpenedDate >= todayFirst) && (x.OpenedDate <= todayLast))
How could I count the unique records within this range by ItemId?
Sounds like you want:
It’s possible that I haven’t really understood you properly though – it’s not clear whether you really want to group by date or item ID
EDIT: If you just want the count of distinct item IDs in that range, you can use: