PIbd-22_Shabunov_O.A._SushiBar/SushiBarDatabaseImplement/Models/Ingredient.cs

24 lines
584 B
C#
Raw Normal View History

2024-05-15 20:43:24 +04:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace SushiBarDatabaseImplement.Models
{
public class Ingredient
{
[Key]
public int Id { get; set; }
[Required]
public string IngredientName { get; set; } = string.Empty;
[Required]
public string Unit { get; set; } = string.Empty;
[Required]
public double Cost { get; set; }
[ForeignKey("IngredientId")]
public virtual List<DishIngredient> DishIngredients { get; set; } = new();
}
}