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 {
[Table("wine_origin"), PrimaryKey("HkId"), Index("Name", IsUnique = true)]
public class WineOrigin {
[Column("hkid")]
public string HkId { get; private set; }
public string HkId { get; private set; } = null!;
[Column("parent_hkid")]
public string? ParentHkId { get; private set; }
@ -18,16 +18,16 @@ namespace Elwig.Models.Entities {
public virtual WineOrigin? Parent { get; private set; }
[Column("name")]
public string Name { get; private set; }
public string Name { get; private set; } = null!;
[Column("blnr")]
public int? BlNr { get; private set; }
[InverseProperty("Origin")]
public virtual ISet<WbGem> Gems { get; private set; }
public virtual ISet<WbGem> Gems { get; private set; } = null!;
[InverseProperty("Parent")]
public virtual ISet<WineOrigin> Children { get; private set; }
public virtual ISet<WineOrigin> Children { get; private set; } = null!;
public int Level => (Parent?.Level + 1) ?? 0;