I have the following DB-Structure: Please ignore where it says NULL
So now I want to use Linq to count where the DateAndTimeDateType.Day
Field equals a given value and where the EventID
is different.
Example:
So from DateAndTimeID
11 to 15, the day is 22.03.2019 and the EventID
is the same for all of them. Now I want to count where the ID is different. So in this case the result should be 1.
At the moment I'm just counting where the Day is the same like shown in following code:
@Model.DateAndTimes
.Where(f => f.DateAndTimeDateType.Value.DayOfYear == renderedDayWithTime.DayOfYear)
.Count()