Переименование проекта

This commit is contained in:
Pyro 2024-12-13 00:11:52 +04:00
parent 68a912864c
commit a5a1099be9
5 changed files with 8 additions and 8 deletions

View File

@ -10,12 +10,12 @@ public class Product
public double Price { get; private set; } public double Price { get; private set; }
public IEnumerable<ProductComponent> ProductComponents { get; private set; } = []; public IEnumerable<ProductComponent> ProductComponents { get; private set; } = [];
public static Product CreateEntity(int id, ConfectioneryType сonfectionaryType, string name, double price, IEnumerable<ProductComponent> productComponents) public static Product CreateEntity(int id, ConfectioneryType сonfectioneryType, string name, double price, IEnumerable<ProductComponent> productComponents)
{ {
return new Product return new Product
{ {
Id = id, Id = id,
ConfectioneryType = сonfectionaryType, ConfectioneryType = сonfectioneryType,
Name = name ?? string.Empty, Name = name ?? string.Empty,
Price = price, Price = price,
ProductComponents = productComponents ProductComponents = productComponents

View File

@ -1,4 +1,4 @@
namespace ProjectConfectionaryFactory.Repositories; namespace ProjectConfectioneryFactory.Repositories;
public interface IConnectionString public interface IConnectionString
{ {

View File

@ -1,4 +1,4 @@
namespace ProjectConfectionaryFactory.Repositories.Implementations; namespace ProjectConfectioneryFactory.Repositories.Implementations;
internal class ConnectionString : IConnectionString internal class ConnectionString : IConnectionString
{ {

View File

@ -30,8 +30,8 @@ public class ProductRepository : IProductRepository
connection.Open(); connection.Open();
using var transaction = connection.BeginTransaction(); using var transaction = connection.BeginTransaction();
var queryInsert = @" var queryInsert = @"
INSERT INTO Products (ConfectionaryType, Name, Price) INSERT INTO Products (ConfectioneryType, Name, Price)
VALUES (@ConfectionaryType, @Name, @Price); VALUES (@ConfectioneryType, @Name, @Price);
SELECT MAX(Id) SELECT MAX(Id)
FROM Products;"; FROM Products;";
var productId = connection.QueryFirst<int>(queryInsert, product, transaction); var productId = connection.QueryFirst<int>(queryInsert, product, transaction);
@ -64,7 +64,7 @@ public class ProductRepository : IProductRepository
var queryUpdate = @" var queryUpdate = @"
UPDATE Products UPDATE Products
SET SET
сonfectionaryType=@сonfectionaryType, сonfectioneryType=@сonfectioneryType,
Name=@Name, Name=@Name,
Price=@Price Price=@Price
WHERE Id=@Id"; WHERE Id=@Id";

View File

@ -6,7 +6,7 @@
{ {
"Name": "File", "Name": "File",
"Args": { "Args": {
"path": "Logs/confectionary_log.txt", "path": "Logs/confectionery_log.txt",
"rollingInterval": "Day" "rollingInterval": "Day"
} }
} }