PIbd-21_BatylkinaAO_MusoevD.../Canteen/CanteenDatabaseImplement/Models/Order.cs
2023-04-07 17:58:07 +03:00

34 lines
1.1 KiB
C#

using CanteenDataModels.Enums;
using CanteenDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CanteenDatabaseImplement.Models
{
public class Order : IOrderModel
{
public int Id { get; private set; }
[Required]
public int VisitorId { get; private set; }
[Required]
public string Description { get; private set; } = string.Empty;
[Required]
public double Sum { get; private set; }
[Required]
public DateTime DateCreate { get; private set; } = DateTime.Now;
[ForeignKey("OrderId")]
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();
[ForeignKey("OrderId")]
public virtual List<OrderTableware> Orderablewares { get; set; } = new();
}
}