using System.ComponentModel.DataAnnotations.Schema; namespace Back.Data.Models { public class OrderItem { public int ID { get; set; } public int OrderID { get; set; } public int? PermissionID { get; set; } public int? PromotionID { get; set; } public int CreditAmount { get; set; } public decimal APrice { get; set; } public decimal Discount { get; set; } public decimal Tax { get; set; } public decimal Total { get { return (CreditAmount * APrice) - Discount + Tax; } } #region Navigation [ForeignKey("OrderID")] public virtual Order Order { get; set; } [ForeignKey("PermissionID")] public virtual Permission? Permission { get; set; } [ForeignKey("PromotionID")] public virtual Promotion? Promotion { get; set; } #endregion } }