[#43] MemberAdminWindow: Do not use Context from ContextWindow any more

This commit is contained in:
2024-03-10 13:05:15 +01:00
parent 239b8a9091
commit 1eba3d9d20
6 changed files with 86 additions and 72 deletions

View File

@ -156,9 +156,10 @@ namespace Elwig.Models.Entities {
[InverseProperty("Member")]
public virtual ISet<AreaCom> AreaCommitments { get; private set; } = null!;
[NotMapped]
public IEnumerable<AreaCom> ActiveAreaCommitments => AreaCommitments
.Where(c => c.YearFrom <= Utils.CurrentYear && (c.YearTo ?? int.MaxValue) >= Utils.CurrentYear);
public IEnumerable<AreaCom> ActiveAreaCommitments(AppDbContext ctx) {
return ctx.AreaCommitments
.Where(c => c.MgNr == MgNr && c.YearFrom <= Utils.CurrentYear && (c.YearTo ?? int.MaxValue) >= Utils.CurrentYear);
}
[InverseProperty("Member")]
public virtual BillingAddr? BillingAddress { get; private set; }