Models: Add Entities/ folder

This commit is contained in:
2023-11-10 13:48:25 +01:00
parent 2f98df87a0
commit 32f229b0a5
63 changed files with 63 additions and 68 deletions

View File

@ -0,0 +1,42 @@
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using IndexAttribute = Microsoft.EntityFrameworkCore.IndexAttribute;
namespace Elwig.Models.Entities {
[Table("branch"), PrimaryKey("ZwstId"), Index("Name", IsUnique = true)]
public class Branch {
[Column("zwstid")]
public string ZwstId { get; set; }
[Column("name")]
public string Name { get; set; }
[Column("country")]
public int? CountryNum { get; set; }
[Column("postal_dest")]
public string? PostalDestId { get; set; }
[Column("address")]
public string? Address { get; set; }
[ForeignKey("CountryNum")]
public virtual Country? Country { get; private set; }
[ForeignKey("CountryNum, PostalDestId")]
public virtual PostalDest? PostalDest { get; private set; }
[Column("phone_nr")]
public string? PhoneNr { get; set; }
[Column("fax_nr")]
public string? FaxNr { get; set; }
[Column("mobile_nr")]
public string? MobileNr { get; set; }
[InverseProperty("Branch")]
public virtual ISet<Member> Members { get; private set; }
}
}