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

29 lines
737 B
C#

using CanteenContracts.ViewModels;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CanteenDatabaseImplement.Models
{
public class LunchOrder
{
public int Id { get; set; }
[Required]
public int LunchId { get; set; }
[Required]
public int OrderId { get; set; }
[Required]
public virtual Lunch Lunch { get; set; } = new();
public virtual Order Order { get; set; } = new();
public LunchOrderViewModel GetViewModel => new()
{
Id = Id,
LunchId = LunchId,
OrderId = OrderId
};
}
}