Models: Add Entities/ folder
This commit is contained in:
42
Elwig/Models/Entities/Branch.cs
Normal file
42
Elwig/Models/Entities/Branch.cs
Normal 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; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user