2024-05-25 17:47:14 +04:00
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using ElectronicsShopDataBaseImplement;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace ElectronicsShopDataBaseImplement.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(Database))]
|
|
|
|
|
partial class DatabaseModelSnapshot : ModelSnapshot
|
|
|
|
|
{
|
|
|
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
|
|
|
|
.HasAnnotation("ProductVersion", "8.0.4")
|
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
|
|
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Client", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("ID")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ClientFIO")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Email")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Password")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("ID");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Clients");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.CostItem", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("ID")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
|
|
|
|
|
2024-05-27 22:05:47 +04:00
|
|
|
|
b.Property<int>("CostNum")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2024-05-25 17:47:14 +04:00
|
|
|
|
b.Property<int>("EmployeeID")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Price")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.HasKey("ID");
|
|
|
|
|
|
2024-05-29 15:31:22 +04:00
|
|
|
|
b.HasIndex("EmployeeID");
|
|
|
|
|
|
2024-05-25 17:47:14 +04:00
|
|
|
|
b.ToTable("CostItems");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Employee", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("ID")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
|
|
|
|
|
|
|
|
|
b.Property<string>("EmployeeFIO")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Login")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Password")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("ID");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Employees");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Order", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("ID")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ClientID")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("DateCreate")
|
|
|
|
|
.HasColumnType("datetime2");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Sum")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.HasKey("ID");
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
b.HasIndex("ClientID");
|
|
|
|
|
|
2024-05-25 17:47:14 +04:00
|
|
|
|
b.ToTable("Orders");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.OrderProduct", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
b.Property<int>("OrderID")
|
2024-05-25 17:47:14 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ProductID")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
b.Property<int?>("_productID")
|
2024-05-25 17:47:14 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProductID");
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
b.HasIndex("_productID");
|
2024-05-25 17:47:14 +04:00
|
|
|
|
|
|
|
|
|
b.ToTable("OrderProducts");
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Paymeant", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("ID")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("OrderID")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("PayOption")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int?>("PaymentID")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("ProductID")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("SumPayment")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.HasKey("ID");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("PaymentID");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Paymeants");
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-25 17:47:14 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Product", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("ID")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ID"));
|
|
|
|
|
|
|
|
|
|
b.Property<int>("CostItemID")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Price")
|
|
|
|
|
.HasColumnType("float");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("ProductName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("ID");
|
|
|
|
|
|
2024-05-29 15:31:22 +04:00
|
|
|
|
b.HasIndex("CostItemID");
|
|
|
|
|
|
2024-05-25 17:47:14 +04:00
|
|
|
|
b.ToTable("Products");
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-29 15:31:22 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.CostItem", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("ElectronicsShopDataBaseImplement.Models.Employee", "Employee")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("EmployeeID")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Employee");
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Order", b =>
|
2024-05-25 17:47:14 +04:00
|
|
|
|
{
|
2024-05-27 14:57:41 +04:00
|
|
|
|
b.HasOne("ElectronicsShopDataBaseImplement.Models.Client", null)
|
|
|
|
|
.WithMany("Orders")
|
|
|
|
|
.HasForeignKey("ClientID")
|
2024-05-25 17:47:14 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
2024-05-27 14:57:41 +04:00
|
|
|
|
});
|
2024-05-25 17:47:14 +04:00
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.OrderProduct", b =>
|
|
|
|
|
{
|
2024-05-25 17:47:14 +04:00
|
|
|
|
b.HasOne("ElectronicsShopDataBaseImplement.Models.Order", "_order")
|
|
|
|
|
.WithMany("Products")
|
2024-05-27 14:57:41 +04:00
|
|
|
|
.HasForeignKey("ProductID")
|
2024-05-25 17:47:14 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
b.HasOne("ElectronicsShopDataBaseImplement.Models.Product", "_product")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("_productID");
|
|
|
|
|
|
2024-05-25 17:47:14 +04:00
|
|
|
|
b.Navigation("_order");
|
|
|
|
|
|
|
|
|
|
b.Navigation("_product");
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Paymeant", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("ElectronicsShopDataBaseImplement.Models.Order", null)
|
|
|
|
|
.WithMany("Payments")
|
|
|
|
|
.HasForeignKey("PaymentID");
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-29 15:31:22 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Product", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("ElectronicsShopDataBaseImplement.Models.CostItem", "CostItem")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("CostItemID")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("CostItem");
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-27 14:57:41 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Client", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Orders");
|
|
|
|
|
});
|
|
|
|
|
|
2024-05-25 17:47:14 +04:00
|
|
|
|
modelBuilder.Entity("ElectronicsShopDataBaseImplement.Models.Order", b =>
|
|
|
|
|
{
|
2024-05-27 14:57:41 +04:00
|
|
|
|
b.Navigation("Payments");
|
|
|
|
|
|
2024-05-25 17:47:14 +04:00
|
|
|
|
b.Navigation("Products");
|
|
|
|
|
});
|
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|