Utils: Add ActiveAreaCommitments()
This commit is contained in:
@ -156,9 +156,8 @@ namespace Elwig.Models.Entities {
|
||||
[InverseProperty(nameof(AreaCom.Member))]
|
||||
public virtual ICollection<AreaCom> AreaCommitments { get; private set; } = null!;
|
||||
|
||||
public IEnumerable<AreaCom> ActiveAreaCommitments(AppDbContext ctx) {
|
||||
return ctx.AreaCommitments
|
||||
.Where(c => c.MgNr == MgNr && c.YearFrom <= Utils.CurrentYear && (c.YearTo ?? int.MaxValue) >= Utils.CurrentYear);
|
||||
public IQueryable<AreaCom> ActiveAreaCommitments(AppDbContext ctx) {
|
||||
return Utils.ActiveAreaCommitments(ctx.AreaCommitments.Where(c => c.MgNr == MgNr));
|
||||
}
|
||||
|
||||
[InverseProperty(nameof(BillingAddr.Member))]
|
||||
|
Reference in New Issue
Block a user