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

@ -9,7 +9,7 @@ namespace Elwig.Models.Entities {
public int MgNr { get; set; }
[Column("date")]
public string DateString { get; set; }
public required string DateString { get; set; }
[NotMapped]
public DateOnly Date {
get => DateOnly.ParseExact(DateString, "yyyy-MM-dd");
@ -20,12 +20,12 @@ namespace Elwig.Models.Entities {
public int BusinessShares { get; set; }
[Column("type")]
public string Type { get; set; }
public required string Type { get; set; }
[Column("comment")]
public string? Comment { get; set; }
[ForeignKey("MgNr")]
public virtual Member Member { get; private set; }
public virtual Member Member { get; private set; } = null!;
}
}