Entities: Use 'required' and '= null!' to get rid of warnings

This commit is contained in:
2024-02-29 15:48:09 +01:00
parent 53a25b3be4
commit f922388db9
40 changed files with 142 additions and 155 deletions

View File

@ -13,10 +13,10 @@ namespace Elwig.Models.Entities {
public int AvNr { get; set; }
[Column("name")]
public string Name { get; set; }
public required string Name { get; set; }
[Column("date")]
public string DateString { get; set; }
public required string DateString { get; set; }
[NotMapped]
public DateOnly Date {
@ -43,18 +43,18 @@ namespace Elwig.Models.Entities {
public string? Comment { get; set; }
[Column("data")]
public string Data { get; set; }
public required string Data { get; set; }
[ForeignKey("Year")]
public virtual Season Season { get; private set; }
public virtual Season Season { get; private set; } = null!;
[InverseProperty("Variant")]
public virtual ISet<PaymentMember> MemberPayments { get; private set; }
public virtual ISet<PaymentMember> MemberPayments { get; private set; } = null!;
[InverseProperty("Variant")]
public virtual ISet<PaymentDeliveryPart> DeliveryPartPayments { get; private set; }
public virtual ISet<PaymentDeliveryPart> DeliveryPartPayments { get; private set; } = null!;
[InverseProperty("Variant")]
public virtual ISet<Credit> Credits { get; private set; }
public virtual ISet<Credit> Credits { get; private set; } = null!;
}
}