Computer_Hardware_Store/HardwareShop/HardwareShopDatabaseImplement/Models/Purchase.cs

38 lines
1.0 KiB
C#
Raw Normal View History

using HardwareShopDataModels.Enums;
using HardwareShopDataModels.Models;
using HardwareShopDataModels.Models;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
namespace HardwareShopDatabaseImplement.Models
{
public class Purchase : IPurchaseModel
{
public int Id { get; set; }
public decimal Sum { get; set; }
public PurchaseStatus PurchaseStatus { get; set; } = PurchaseStatus.Неизвестен;
public DateTime? DatePurchase { get; set; }
public int UserID { get; set; }
public virtual User User { get; set; }
[NotMapped]
public Dictionary<int, (IBuildModel, int)>? PurchaseBuilds { get; set; }
[NotMapped]
public Dictionary<int, (IGoodModel, int)> PurchaseGoods { get; set; } = new();
[ForeignKey("PurchaseId")]
public virtual List<PurchaseBuild>? Builds { get; set; }
[ForeignKey("PurchaseId")]
public virtual List<PurchaseGood> Goods { get; set; } = new();
}
}