From a5a1099be9d26fa26f3688d4a45da426444b3f4c Mon Sep 17 00:00:00 2001 From: Pyro <732603@gmail.com> Date: Fri, 13 Dec 2024 00:11:52 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B8=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectConfectioneryFactory/Entities/Product.cs | 4 ++-- .../Repositories/IConnectionString.cs | 2 +- .../Repositories/Implementations/ConnectionString.cs | 2 +- .../Repositories/Implementations/ProductRepository.cs | 6 +++--- .../ProjectConfectioneryFactory/appsettings.json | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Entities/Product.cs b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Entities/Product.cs index 2759cf9..a94af95 100644 --- a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Entities/Product.cs +++ b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Entities/Product.cs @@ -10,12 +10,12 @@ public class Product public double Price { get; private set; } public IEnumerable ProductComponents { get; private set; } = []; - public static Product CreateEntity(int id, ConfectioneryType сonfectionaryType, string name, double price, IEnumerable productComponents) + public static Product CreateEntity(int id, ConfectioneryType сonfectioneryType, string name, double price, IEnumerable productComponents) { return new Product { Id = id, - ConfectioneryType = сonfectionaryType, + ConfectioneryType = сonfectioneryType, Name = name ?? string.Empty, Price = price, ProductComponents = productComponents diff --git a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/IConnectionString.cs b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/IConnectionString.cs index 3a8ab9f..923d63b 100644 --- a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/IConnectionString.cs +++ b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/IConnectionString.cs @@ -1,4 +1,4 @@ -namespace ProjectConfectionaryFactory.Repositories; +namespace ProjectConfectioneryFactory.Repositories; public interface IConnectionString { diff --git a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/Implementations/ConnectionString.cs b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/Implementations/ConnectionString.cs index 27da614..032a032 100644 --- a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/Implementations/ConnectionString.cs +++ b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/Implementations/ConnectionString.cs @@ -1,4 +1,4 @@ -namespace ProjectConfectionaryFactory.Repositories.Implementations; +namespace ProjectConfectioneryFactory.Repositories.Implementations; internal class ConnectionString : IConnectionString { diff --git a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/Implementations/ProductRepository.cs b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/Implementations/ProductRepository.cs index 2926be5..3188279 100644 --- a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/Implementations/ProductRepository.cs +++ b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/Repositories/Implementations/ProductRepository.cs @@ -30,8 +30,8 @@ public class ProductRepository : IProductRepository connection.Open(); using var transaction = connection.BeginTransaction(); var queryInsert = @" - INSERT INTO Products (ConfectionaryType, Name, Price) - VALUES (@ConfectionaryType, @Name, @Price); + INSERT INTO Products (ConfectioneryType, Name, Price) + VALUES (@ConfectioneryType, @Name, @Price); SELECT MAX(Id) FROM Products;"; var productId = connection.QueryFirst(queryInsert, product, transaction); @@ -64,7 +64,7 @@ public class ProductRepository : IProductRepository var queryUpdate = @" UPDATE Products SET - сonfectionaryType=@сonfectionaryType, + сonfectioneryType=@сonfectioneryType, Name=@Name, Price=@Price WHERE Id=@Id"; diff --git a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/appsettings.json b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/appsettings.json index 87b332f..68cfd48 100644 --- a/ProjectConfectioneryFactory/ProjectConfectioneryFactory/appsettings.json +++ b/ProjectConfectioneryFactory/ProjectConfectioneryFactory/appsettings.json @@ -6,7 +6,7 @@ { "Name": "File", "Args": { - "path": "Logs/confectionary_log.txt", + "path": "Logs/confectionery_log.txt", "rollingInterval": "Day" } }