PIbd-21_BatylkinaAO_MusoevD.../Canteen/CanteenDatabaseImplement/Models/Order.cs

34 lines
1.1 KiB
C#
Raw Normal View History

2023-04-07 10:55:40 +04:00
using CanteenDataModels.Enums;
using CanteenDataModels.Models;
using System;
using System.Collections.Generic;
2023-04-07 18:58:07 +04:00
using System.ComponentModel.DataAnnotations;
2023-04-07 10:55:40 +04:00
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CanteenDatabaseImplement.Models
{
public class Order : IOrderModel
{
2023-04-07 18:58:07 +04:00
public int Id { get; private set; }
[Required]
public int VisitorId { get; private set; }
[Required]
public string Description { get; private set; } = string.Empty;
[Required]
2023-04-07 10:55:40 +04:00
public double Sum { get; private set; }
2023-04-07 18:58:07 +04:00
[Required]
2023-04-07 10:55:40 +04:00
public DateTime DateCreate { get; private set; } = DateTime.Now;
[ForeignKey("OrderId")]
2023-04-07 18:58:07 +04:00
public virtual List<OrderLunch> OrderLunches { get; set; } = new();
[ForeignKey("OrderId")]
public virtual List<OrderCook> OrderCooks { get; set; } = new();
[ForeignKey("OrderId")]
public virtual List<OrderDish> OrderDishes { get; set; } = new();
2023-04-07 10:55:40 +04:00
[ForeignKey("OrderId")]
2023-04-07 18:58:07 +04:00
public virtual List<OrderTableware> Orderablewares { get; set; } = new();
2023-04-07 10:55:40 +04:00
}
}