Only show active contract area
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
using Elwig.Helpers;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -144,6 +145,11 @@ namespace Elwig.Models {
|
||||
[InverseProperty("Member")]
|
||||
public virtual ISet<Contract> Contracts { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public virtual ISet<Contract> ActiveContracts => Contracts
|
||||
.Where(c => c.YearFrom <= Utils.CurrentSeason && (c.YearTo ?? int.MaxValue) >= Utils.CurrentSeason)
|
||||
.ToHashSet();
|
||||
|
||||
[InverseProperty("Member")]
|
||||
public virtual BillingAddr BillingAddress { get; private set; }
|
||||
|
||||
|
Reference in New Issue
Block a user