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,32 @@
using Elwig.Helpers;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations.Schema;
namespace Elwig.Models.Entities {
[Table("member_billing_address"), PrimaryKey("MgNr")]
public class BillingAddr : IAddress {
[Column("mgnr")]
public int MgNr { 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("MgNr")]
public virtual Member Member { get; private set; }
[ForeignKey("CountryNum")]
public virtual Country Country { get; private set; }
[ForeignKey("CountryNum, PostalDestId")]
public virtual PostalDest PostalDest { get; private set; }
}
}