//
using System;
using CanteenDatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace CanteenDatabaseImplement.Migrations
{
[DbContext(typeof(CanteenDatabase))]
partial class CanteenDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.18")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("CanteenDatabaseImplement.Models.Client", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClientFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Cook", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("CookFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Cooks");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Dish", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("DishName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("DishPrice")
.HasColumnType("float");
b.HasKey("Id");
b.ToTable("Dishes");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.DishIngredient", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("Count")
.HasColumnType("int");
b.Property("DishId")
.HasColumnType("int");
b.Property("IngredientId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DishId");
b.HasIndex("IngredientId");
b.ToTable("DishIngredients");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Ingredient", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("IngredientCost")
.HasColumnType("float");
b.Property("IngredientName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Ingredients");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Order", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
b.Property("ClientId")
.HasColumnType("int");
b.Property("CookId")
.HasColumnType("int");
b.Property("DateCreate")
.HasColumnType("datetime2");
b.Property("DateImplement")
.HasColumnType("datetime2");
b.Property("DishCount")
.HasColumnType("int");
b.Property("DishId")
.HasColumnType("int");
b.Property("OrderPrice")
.HasColumnType("float");
b.Property("OrderStatus")
.HasColumnType("int");
b.Property("PaymentStatus")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ClientId");
b.HasIndex("CookId");
b.HasIndex("DishId");
b.ToTable("Orders");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.DishIngredient", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Dish", "Dish")
.WithMany("Ingredients")
.HasForeignKey("DishId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CanteenDatabaseImplement.Models.Ingredient", "Ingredient")
.WithMany("DishIngredients")
.HasForeignKey("IngredientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Dish");
b.Navigation("Ingredient");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Order", b =>
{
b.HasOne("CanteenDatabaseImplement.Models.Client", "Client")
.WithMany("Orders")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CanteenDatabaseImplement.Models.Cook", "Cook")
.WithMany("Orders")
.HasForeignKey("CookId");
b.HasOne("CanteenDatabaseImplement.Models.Dish", "Dish")
.WithMany("Orders")
.HasForeignKey("DishId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
b.Navigation("Cook");
b.Navigation("Dish");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Client", b =>
{
b.Navigation("Orders");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Cook", b =>
{
b.Navigation("Orders");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Dish", b =>
{
b.Navigation("Ingredients");
b.Navigation("Orders");
});
modelBuilder.Entity("CanteenDatabaseImplement.Models.Ingredient", b =>
{
b.Navigation("DishIngredients");
});
#pragma warning restore 612, 618
}
}
}