public Availability GetUnavailabilityForDay(int employeeId, DateTime date) { return(_db.Availabilities.FirstOrDefault( a => a.Employee.Id == employeeId && FestispecContext.TruncateTime(a.StartTime) == FestispecContext.TruncateTime(date) && a.EventTitle == "Niet beschikbaar")); }
public async Task <List <PlannedInspection> > GetPlannedInspections(int employeeId) { var plannedInspections = await _db.PlannedInspections .Include(e => e.Employee) .Where(e => e.Employee.Id == employeeId && FestispecContext.TruncateTime(e.StartTime) == FestispecContext.TruncateTime(DateTime.Now)) .ToListAsync(); if (plannedInspections.Count < 1) { throw new EntityNotFoundException(); } return(plannedInspections); }