Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Commit

Permalink
Reverted back to lazy evaluation of GetByOrganization
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasanker committed Oct 1, 2019
1 parent d4809da commit 97ae7e5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions API/Data/Services/ShiftService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ public IEnumerable<Shift> GetByOrganization(string shortKey, DateTime from, Date
/// <inheritdoc cref="IShiftService.GetByOrganization(int, DateTime, DateTime)"/>
public IEnumerable<Shift> GetByOrganization(int id, DateTime from, DateTime to)
{
var result = GetByOrganization(id).AsQueryable().Where(shift => shift.End >= from && shift.Start <= to);
if (result == null)
{
return new List<Shift>();
}
return result.ToList();
return GetByOrganization(id).AsQueryable().Where(shift => shift.End >= from && shift.Start <= to);
}

/// <inheritdoc cref="IShiftService.GetByOrganization(string, DateTime)"/>
Expand Down

0 comments on commit 97ae7e5

Please sign in to comment.