Utils: Add ActiveAreaCommitments()
This commit is contained in:
1 parent
c6e83ffff4
commit
3f9c4cb1f6
5 files changed
+15
-6
No files matched your search
@@ -488,5 +488,15 @@ namespace Elwig.Helpers {
|
||||
return obj.GetHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query) => ActiveAreaCommitments(query, CurrentYear);
|
||||
public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query, int yearTo) {
|
||||
return query.Where(c => (c.YearFrom <= CurrentYear) && (c.YearTo == null || c.YearTo >= yearTo));
|
||||
}
|
||||
|
||||
public static IEnumerable<AreaCom> ActiveAreaCommitments(IEnumerable<AreaCom> query) => ActiveAreaCommitments(query, CurrentYear);
|
||||
public static IEnumerable<AreaCom> ActiveAreaCommitments(IEnumerable<AreaCom> query, int yearTo) {
|
||||
return query.Where(c => (c.YearFrom <= CurrentYear) && (c.YearTo == null || c.YearTo >= yearTo));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user