AreaCom: Make YearFrom nullable
All checks were successful
Test / Run tests (push) Successful in 1m48s

This commit is contained in:
2024-09-18 14:38:53 +02:00
parent d8beb03b96
commit 21a1b11d68
8 changed files with 25 additions and 7 deletions

View File

@ -560,7 +560,7 @@ namespace Elwig.Helpers {
public static Expression<Func<AreaCom, bool>> ActiveAreaCommitments() => ActiveAreaCommitments(CurrentYear);
public static Expression<Func<AreaCom, bool>> ActiveAreaCommitments(int year) =>
c => (c.YearFrom <= year) && (c.YearTo == null || c.YearTo >= year);
c => (c.YearFrom == null || c.YearFrom <= year) && (c.YearTo == null || c.YearTo >= year);
public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query) => ActiveAreaCommitments(query, CurrentYear);
public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query, int year) =>