From df014f7d5235b395c2748138f36ac772afcb557c Mon Sep 17 00:00:00 2001 From: antoc0der <1@DESKTOP-K1L8ND3> Date: Tue, 7 May 2024 17:36:18 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=B0=D0=BA=D0=B0=D1=8F=20=D1=82=D0=BE?= =?UTF-8?q?=20=D0=BD=D0=B5=D0=BF=D0=BE=D0=BB=D0=B0=D0=B4=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MailWorker/MailKitWorker.cs | 6 +- .../20240430175003_InitialCreate.Designer.cs | 292 ------------------ .../20240430175003_InitialCreate.cs | 211 ------------- ... 20240507112917_InitialCreate.Designer.cs} | 41 ++- ...ate.cs => 20240507112917_InitialCreate.cs} | 29 ++ .../FlowerShopDataBaseModelSnapshot.cs | 39 +++ FlowerShopListImplement/MessageInfoStorage.cs | 2 + FlowerShopRestApi/appsettings.json | 6 +- ProjectFlowerShop/App.config | 11 + ProjectFlowerShop/Program.cs | 15 +- 10 files changed, 136 insertions(+), 516 deletions(-) delete mode 100644 FlowerShopDatabaseImplement/Migrations/20240430175003_InitialCreate.Designer.cs delete mode 100644 FlowerShopDatabaseImplement/Migrations/20240430175003_InitialCreate.cs rename FlowerShopDatabaseImplement/Migrations/{20240422170012_InitialCreate.Designer.cs => 20240507112917_InitialCreate.Designer.cs} (86%) rename FlowerShopDatabaseImplement/Migrations/{20240422170012_InitialCreate.cs => 20240507112917_InitialCreate.cs} (85%) create mode 100644 ProjectFlowerShop/App.config diff --git a/FlowerShopBusinessLogic/MailWorker/MailKitWorker.cs b/FlowerShopBusinessLogic/MailWorker/MailKitWorker.cs index 647161f..3013628 100644 --- a/FlowerShopBusinessLogic/MailWorker/MailKitWorker.cs +++ b/FlowerShopBusinessLogic/MailWorker/MailKitWorker.cs @@ -21,8 +21,7 @@ namespace FlowerShopBusinessLogic.MailWorker info) { using var objMailMessage = new MailMessage(); - using var objSmtpClient = new SmtpClient(_smtpClientHost, - _smtpClientPort); + using var objSmtpClient = new SmtpClient(_smtpClientHost,_smtpClientPort); try { objMailMessage.From = new MailAddress(_mailLogin); @@ -34,8 +33,7 @@ namespace FlowerShopBusinessLogic.MailWorker objSmtpClient.UseDefaultCredentials = false; objSmtpClient.EnableSsl = true; objSmtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; - objSmtpClient.Credentials = new NetworkCredential(_mailLogin, - _mailPassword); + objSmtpClient.Credentials = new NetworkCredential(_mailLogin,_mailPassword); await Task.Run(() => objSmtpClient.Send(objMailMessage)); } catch (Exception) diff --git a/FlowerShopDatabaseImplement/Migrations/20240430175003_InitialCreate.Designer.cs b/FlowerShopDatabaseImplement/Migrations/20240430175003_InitialCreate.Designer.cs deleted file mode 100644 index 633543b..0000000 --- a/FlowerShopDatabaseImplement/Migrations/20240430175003_InitialCreate.Designer.cs +++ /dev/null @@ -1,292 +0,0 @@ -// -using System; -using FlowerShopDatabaseImplement; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace FlowerShopDatabaseImplement.Migrations -{ - [DbContext(typeof(FlowerShopDataBase))] - [Migration("20240430175003_InitialCreate")] - partial class InitialCreate - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "6.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Client", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - 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("FlowerShopDatabaseImplement.Models.Component", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ComponentName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Cost") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Components"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Flower", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("FlowerName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Price") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.ToTable("Flowers"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.FlowerComponent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ComponentId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("FlowerId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ComponentId"); - - b.HasIndex("FlowerId"); - - b.ToTable("FlowerComponents"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ClientId") - .HasColumnType("int"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("DateCreate") - .HasColumnType("datetime2"); - - b.Property("DateImplement") - .HasColumnType("datetime2"); - - b.Property("FlowerId") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Sum") - .HasColumnType("float"); - - b.HasKey("Id"); - - b.HasIndex("ClientId"); - - b.HasIndex("FlowerId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Shop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Address") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DateOpen") - .HasColumnType("datetime2"); - - b.Property("MaxCapacity") - .HasColumnType("int"); - - b.Property("ShopName") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Shops"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.ShopFlower", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("FlowerId") - .HasColumnType("int"); - - b.Property("ShopId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FlowerId"); - - b.HasIndex("ShopId"); - - b.ToTable("ShopFlowers"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.FlowerComponent", b => - { - b.HasOne("FlowerShopDatabaseImplement.Models.Component", "Component") - .WithMany("FlowerComponents") - .HasForeignKey("ComponentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FlowerShopDatabaseImplement.Models.Flower", "Flower") - .WithMany("Components") - .HasForeignKey("FlowerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Component"); - - b.Navigation("Flower"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => - { - b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client") - .WithMany("Orders") - .HasForeignKey("ClientId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FlowerShopDatabaseImplement.Models.Flower", "Flower") - .WithMany("Orders") - .HasForeignKey("FlowerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Client"); - - b.Navigation("Flower"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.ShopFlower", b => - { - b.HasOne("FlowerShopDatabaseImplement.Models.Flower", "Flower") - .WithMany("ShopFlowers") - .HasForeignKey("FlowerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("FlowerShopDatabaseImplement.Models.Shop", "Shop") - .WithMany("Flowers") - .HasForeignKey("ShopId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Flower"); - - b.Navigation("Shop"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Client", b => - { - b.Navigation("Orders"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Component", b => - { - b.Navigation("FlowerComponents"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Flower", b => - { - b.Navigation("Components"); - - b.Navigation("Orders"); - - b.Navigation("ShopFlowers"); - }); - - modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Shop", b => - { - b.Navigation("Flowers"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/FlowerShopDatabaseImplement/Migrations/20240430175003_InitialCreate.cs b/FlowerShopDatabaseImplement/Migrations/20240430175003_InitialCreate.cs deleted file mode 100644 index 8acfd07..0000000 --- a/FlowerShopDatabaseImplement/Migrations/20240430175003_InitialCreate.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace FlowerShopDatabaseImplement.Migrations -{ - public partial class InitialCreate : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Clients", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ClientFIO = table.Column(type: "nvarchar(max)", nullable: false), - Email = table.Column(type: "nvarchar(max)", nullable: false), - Password = table.Column(type: "nvarchar(max)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Clients", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Components", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ComponentName = table.Column(type: "nvarchar(max)", nullable: false), - Cost = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Components", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Flowers", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - FlowerName = table.Column(type: "nvarchar(max)", nullable: false), - Price = table.Column(type: "float", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Flowers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Shops", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ShopName = table.Column(type: "nvarchar(max)", nullable: false), - Address = table.Column(type: "nvarchar(max)", nullable: false), - DateOpen = table.Column(type: "datetime2", nullable: false), - MaxCapacity = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Shops", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "FlowerComponents", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - FlowerId = table.Column(type: "int", nullable: false), - ComponentId = table.Column(type: "int", nullable: false), - Count = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_FlowerComponents", x => x.Id); - table.ForeignKey( - name: "FK_FlowerComponents_Components_ComponentId", - column: x => x.ComponentId, - principalTable: "Components", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_FlowerComponents_Flowers_FlowerId", - column: x => x.FlowerId, - principalTable: "Flowers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Orders", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Count = table.Column(type: "int", nullable: false), - Sum = table.Column(type: "float", nullable: false), - Status = table.Column(type: "int", nullable: false), - DateCreate = table.Column(type: "datetime2", nullable: false), - DateImplement = table.Column(type: "datetime2", nullable: true), - FlowerId = table.Column(type: "int", nullable: false), - ClientId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders", x => x.Id); - table.ForeignKey( - name: "FK_Orders_Clients_ClientId", - column: x => x.ClientId, - principalTable: "Clients", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Orders_Flowers_FlowerId", - column: x => x.FlowerId, - principalTable: "Flowers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ShopFlowers", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - FlowerId = table.Column(type: "int", nullable: false), - ShopId = table.Column(type: "int", nullable: false), - Count = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ShopFlowers", x => x.Id); - table.ForeignKey( - name: "FK_ShopFlowers_Flowers_FlowerId", - column: x => x.FlowerId, - principalTable: "Flowers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ShopFlowers_Shops_ShopId", - column: x => x.ShopId, - principalTable: "Shops", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_FlowerComponents_ComponentId", - table: "FlowerComponents", - column: "ComponentId"); - - migrationBuilder.CreateIndex( - name: "IX_FlowerComponents_FlowerId", - table: "FlowerComponents", - column: "FlowerId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ClientId", - table: "Orders", - column: "ClientId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_FlowerId", - table: "Orders", - column: "FlowerId"); - - migrationBuilder.CreateIndex( - name: "IX_ShopFlowers_FlowerId", - table: "ShopFlowers", - column: "FlowerId"); - - migrationBuilder.CreateIndex( - name: "IX_ShopFlowers_ShopId", - table: "ShopFlowers", - column: "ShopId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "FlowerComponents"); - - migrationBuilder.DropTable( - name: "Orders"); - - migrationBuilder.DropTable( - name: "ShopFlowers"); - - migrationBuilder.DropTable( - name: "Components"); - - migrationBuilder.DropTable( - name: "Clients"); - - migrationBuilder.DropTable( - name: "Flowers"); - - migrationBuilder.DropTable( - name: "Shops"); - } - } -} diff --git a/FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.Designer.cs b/FlowerShopDatabaseImplement/Migrations/20240507112917_InitialCreate.Designer.cs similarity index 86% rename from FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.Designer.cs rename to FlowerShopDatabaseImplement/Migrations/20240507112917_InitialCreate.Designer.cs index 2d43d3a..a4a8e53 100644 --- a/FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.Designer.cs +++ b/FlowerShopDatabaseImplement/Migrations/20240507112917_InitialCreate.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace FlowerShopDatabaseImplement.Migrations { [DbContext(typeof(FlowerShopDataBase))] - [Migration("20240422170012_InitialCreate")] + [Migration("20240507112917_InitialCreate")] partial class InitialCreate { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -142,6 +142,36 @@ namespace FlowerShopDatabaseImplement.Migrations b.ToTable("Implementers"); }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.MessageInfo", b => + { + b.Property("MessageId") + .HasColumnType("nvarchar(450)"); + + b.Property("Body") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("DateDelivery") + .HasColumnType("datetime2"); + + b.Property("SenderName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("MessageId"); + + b.HasIndex("ClientId"); + + b.ToTable("Messages"); + }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => { b.Property("Id") @@ -204,6 +234,15 @@ namespace FlowerShopDatabaseImplement.Migrations b.Navigation("Flower"); }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.MessageInfo", b => + { + b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client") + .WithMany() + .HasForeignKey("ClientId"); + + b.Navigation("Client"); + }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => { b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client") diff --git a/FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.cs b/FlowerShopDatabaseImplement/Migrations/20240507112917_InitialCreate.cs similarity index 85% rename from FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.cs rename to FlowerShopDatabaseImplement/Migrations/20240507112917_InitialCreate.cs index 60ff657..3eb743d 100644 --- a/FlowerShopDatabaseImplement/Migrations/20240422170012_InitialCreate.cs +++ b/FlowerShopDatabaseImplement/Migrations/20240507112917_InitialCreate.cs @@ -68,6 +68,27 @@ namespace FlowerShopDatabaseImplement.Migrations table.PrimaryKey("PK_Implementers", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Messages", + columns: table => new + { + MessageId = table.Column(type: "nvarchar(450)", nullable: false), + ClientId = table.Column(type: "int", nullable: true), + SenderName = table.Column(type: "nvarchar(max)", nullable: false), + DateDelivery = table.Column(type: "datetime2", nullable: false), + Subject = table.Column(type: "nvarchar(max)", nullable: false), + Body = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Messages", x => x.MessageId); + table.ForeignKey( + name: "FK_Messages_Clients_ClientId", + column: x => x.ClientId, + principalTable: "Clients", + principalColumn: "Id"); + }); + migrationBuilder.CreateTable( name: "FlowerComponents", columns: table => new @@ -142,6 +163,11 @@ namespace FlowerShopDatabaseImplement.Migrations table: "FlowerComponents", column: "FlowerId"); + migrationBuilder.CreateIndex( + name: "IX_Messages_ClientId", + table: "Messages", + column: "ClientId"); + migrationBuilder.CreateIndex( name: "IX_Orders_ClientId", table: "Orders", @@ -163,6 +189,9 @@ namespace FlowerShopDatabaseImplement.Migrations migrationBuilder.DropTable( name: "FlowerComponents"); + migrationBuilder.DropTable( + name: "Messages"); + migrationBuilder.DropTable( name: "Orders"); diff --git a/FlowerShopDatabaseImplement/Migrations/FlowerShopDataBaseModelSnapshot.cs b/FlowerShopDatabaseImplement/Migrations/FlowerShopDataBaseModelSnapshot.cs index 2fc7426..2b6646c 100644 --- a/FlowerShopDatabaseImplement/Migrations/FlowerShopDataBaseModelSnapshot.cs +++ b/FlowerShopDatabaseImplement/Migrations/FlowerShopDataBaseModelSnapshot.cs @@ -140,6 +140,36 @@ namespace FlowerShopDatabaseImplement.Migrations b.ToTable("Implementers"); }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.MessageInfo", b => + { + b.Property("MessageId") + .HasColumnType("nvarchar(450)"); + + b.Property("Body") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .HasColumnType("int"); + + b.Property("DateDelivery") + .HasColumnType("datetime2"); + + b.Property("SenderName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("MessageId"); + + b.HasIndex("ClientId"); + + b.ToTable("Messages"); + }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => { b.Property("Id") @@ -202,6 +232,15 @@ namespace FlowerShopDatabaseImplement.Migrations b.Navigation("Flower"); }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.MessageInfo", b => + { + b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client") + .WithMany() + .HasForeignKey("ClientId"); + + b.Navigation("Client"); + }); + modelBuilder.Entity("FlowerShopDatabaseImplement.Models.Order", b => { b.HasOne("FlowerShopDatabaseImplement.Models.Client", "Client") diff --git a/FlowerShopListImplement/MessageInfoStorage.cs b/FlowerShopListImplement/MessageInfoStorage.cs index 6e11976..0a88cf2 100644 --- a/FlowerShopListImplement/MessageInfoStorage.cs +++ b/FlowerShopListImplement/MessageInfoStorage.cs @@ -2,6 +2,8 @@ using FlowerShopContracts.SearchModels; using FlowerShopContracts.StoragesContracts; using FlowerShopContracts.ViewModels; +using FlowerShopListImplement.Models; + using System; using System.Collections.Generic; using System.Linq; diff --git a/FlowerShopRestApi/appsettings.json b/FlowerShopRestApi/appsettings.json index 9733041..c36e36b 100644 --- a/FlowerShopRestApi/appsettings.json +++ b/FlowerShopRestApi/appsettings.json @@ -6,11 +6,11 @@ } }, "AllowedHosts": "*", - "SmtpClientHost\": \"smtp.gmail.com\",": null, + "SmtpClientHost": "smtp.gmail.com", "SmtpClientPort": "587", "PopHost": "pop.gmail.com", "PopPort": "995", - "MailLogin": "sasda3183@gmail.com", - "MailPassword": "ozxp vjof uinv fcmj" + "MailLogin": "anasirov48@gmail.com", + "MailPassword": "xoac ehyi tnar fiho" } diff --git a/ProjectFlowerShop/App.config b/ProjectFlowerShop/App.config new file mode 100644 index 0000000..8926448 --- /dev/null +++ b/ProjectFlowerShop/App.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ProjectFlowerShop/Program.cs b/ProjectFlowerShop/Program.cs index 0c00fca..a8daa98 100644 --- a/ProjectFlowerShop/Program.cs +++ b/ProjectFlowerShop/Program.cs @@ -1,4 +1,6 @@ using FlowerShopBusinessLogic.BusinessLogic; +using FlowerShopBusinessLogic.MailWorker; + using FlowerShopContracts.BusinessLogicsContracts; using FlowerShopContracts.StoragesContracts; using FlowerShopDatabaseImplement.Implements; @@ -11,7 +13,6 @@ using System.Drawing; using FlowerShopBusinessLogic; using FlowerShopBusinessLogic.OfficePackage.Implements; using FlowerShopBusinessLogic.OfficePackage; -using FlowerShopBusinessLogic.MailWorker; using FlowerShopContracts.BindingModels; namespace ProjectFlowerShop @@ -74,15 +75,18 @@ namespace ProjectFlowerShop services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); services.AddTransient(); - services.AddTransient(); services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -97,6 +101,7 @@ namespace ProjectFlowerShop services.AddTransient(); services.AddTransient(); + services.AddSingleton(); services.AddTransient(); services.AddTransient(); services.AddTransient();