From d2032306448b559a236766e4781253a29b16a540 Mon Sep 17 00:00:00 2001 From: "nikbel2004@outlook.com" Date: Sat, 11 May 2024 01:54:17 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FurnitureAssemblyBusinessLogic.csproj | 30 ++++---- ... 20240510215346_InitialCreate.Designer.cs} | 70 +++++++++---------- ...ial.cs => 20240510215346_InitialCreate.cs} | 2 +- .../FurnitureAssemblyDatabaseModelSnapshot.cs | 66 ++++++++--------- .../Models/Client.cs | 4 +- .../Models/Furniture.cs | 6 +- 6 files changed, 89 insertions(+), 89 deletions(-) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/{20240422070105_Initial.Designer.cs => 20240510215346_InitialCreate.Designer.cs} (96%) rename FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/{20240422070105_Initial.cs => 20240510215346_InitialCreate.cs} (99%) diff --git a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj index b222f5e..924efab 100644 --- a/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj +++ b/FurnitureAssembly/FurnitureAssemblyBusinessLogic/FurnitureAssemblyBusinessLogic.csproj @@ -1,21 +1,21 @@  - - net6.0 - enable - enable - + + net6.0 + enable + enable + - - - - - - - + + + + + + + - - - + + + diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240422070105_Initial.Designer.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240510215346_InitialCreate.Designer.cs similarity index 96% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240422070105_Initial.Designer.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240510215346_InitialCreate.Designer.cs index 7f05ab1..d3cfad1 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240422070105_Initial.Designer.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240510215346_InitialCreate.Designer.cs @@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace FurnitureAssemblyDatabaseImplement.Migrations { [DbContext(typeof(FurnitureAssemblyDatabase))] - [Migration("20240422070105_Initial")] - partial class Initial + [Migration("20240510215346_InitialCreate")] + partial class InitialCreate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -25,33 +25,6 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Shop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DateOpen") - .HasColumnType("datetime2"); - - b.Property("MaxCountFurnitures") - .HasColumnType("int"); - - b.Property("ShopName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Shops"); - }); - modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b => { b.Property("Id") @@ -161,6 +134,33 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations b.ToTable("Orders"); }); + modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Shop", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateOpen") + .HasColumnType("datetime2"); + + b.Property("MaxCountFurnitures") + .HasColumnType("int"); + + b.Property("ShopName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Shops"); + }); + modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.ShopFurniture", b => { b.Property("Id") @@ -253,7 +253,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("BlacksmithWorkshopDatabaseImplement.Models.Shop", "Shop") + b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Shop", "Shop") .WithMany("Furnitures") .HasForeignKey("ShopId") .OnDelete(DeleteBehavior.Cascade) @@ -264,11 +264,6 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations b.Navigation("Shop"); }); - modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Shop", b => - { - b.Navigation("Furnitures"); - }); - modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b => { b.Navigation("Orders"); @@ -283,6 +278,11 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations b.Navigation("WorkPieces"); }); + modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Shop", b => + { + b.Navigation("Furnitures"); + }); + modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b => { b.Navigation("FurnitureWorkPieces"); diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240422070105_Initial.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240510215346_InitialCreate.cs similarity index 99% rename from FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240422070105_Initial.cs rename to FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240510215346_InitialCreate.cs index cbaa5e3..394d14b 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240422070105_Initial.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/20240510215346_InitialCreate.cs @@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace FurnitureAssemblyDatabaseImplement.Migrations { /// - public partial class Initial : Migration + public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/FurnitureAssemblyDatabaseModelSnapshot.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/FurnitureAssemblyDatabaseModelSnapshot.cs index 1586cfb..3d1f410 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/FurnitureAssemblyDatabaseModelSnapshot.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Migrations/FurnitureAssemblyDatabaseModelSnapshot.cs @@ -22,33 +22,6 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Shop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Address") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DateOpen") - .HasColumnType("datetime2"); - - b.Property("MaxCountFurnitures") - .HasColumnType("int"); - - b.Property("ShopName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Shops"); - }); - modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b => { b.Property("Id") @@ -158,6 +131,33 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations b.ToTable("Orders"); }); + modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Shop", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateOpen") + .HasColumnType("datetime2"); + + b.Property("MaxCountFurnitures") + .HasColumnType("int"); + + b.Property("ShopName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Shops"); + }); + modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.ShopFurniture", b => { b.Property("Id") @@ -250,7 +250,7 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.HasOne("BlacksmithWorkshopDatabaseImplement.Models.Shop", "Shop") + b.HasOne("FurnitureAssemblyDatabaseImplement.Models.Shop", "Shop") .WithMany("Furnitures") .HasForeignKey("ShopId") .OnDelete(DeleteBehavior.Cascade) @@ -261,11 +261,6 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations b.Navigation("Shop"); }); - modelBuilder.Entity("BlacksmithWorkshopDatabaseImplement.Models.Shop", b => - { - b.Navigation("Furnitures"); - }); - modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Client", b => { b.Navigation("Orders"); @@ -280,6 +275,11 @@ namespace FurnitureAssemblyDatabaseImplement.Migrations b.Navigation("WorkPieces"); }); + modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.Shop", b => + { + b.Navigation("Furnitures"); + }); + modelBuilder.Entity("FurnitureAssemblyDatabaseImplement.Models.WorkPiece", b => { b.Navigation("FurnitureWorkPieces"); diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Client.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Client.cs index 9d1b822..28778e7 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Client.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Client.cs @@ -34,7 +34,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models { return null; } - return new() + return new Client() { Id = model.Id, ClientFIO = model.ClientFIO, @@ -59,7 +59,7 @@ namespace FurnitureAssemblyDatabaseImplement.Models Id = Id, ClientFIO = ClientFIO, Email = Email, - Password = Password, + Password = Password }; } } diff --git a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Furniture.cs b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Furniture.cs index f9d5968..6c2e16c 100644 --- a/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Furniture.cs +++ b/FurnitureAssembly/FurnitureAssemblyDatabaseImplement/Models/Furniture.cs @@ -101,13 +101,13 @@ namespace FurnitureAssemblyDatabaseImplement.Models var furniture = context.Furnitures.First(x => x.Id == Id); - foreach(var mwp in model.FurnitureWorkPieces) + foreach(var fwp in model.FurnitureWorkPieces) { context.FurnitureWorkPieces.Add(new FurnitureWorkPiece { Furniture = furniture, - WorkPiece = context.WorkPieces.First(x => x.Id == mwp.Key), - Count = mwp.Value.Item2 + WorkPiece = context.WorkPieces.First(x => x.Id == fwp.Key), + Count = fwp.Value.Item2 }); context.SaveChanges();