Переименование проекта
This commit is contained in:
parent
68a912864c
commit
a5a1099be9
@ -10,12 +10,12 @@ public class Product
|
||||
public double Price { 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
|
||||
{
|
||||
Id = id,
|
||||
ConfectioneryType = сonfectionaryType,
|
||||
ConfectioneryType = сonfectioneryType,
|
||||
Name = name ?? string.Empty,
|
||||
Price = price,
|
||||
ProductComponents = productComponents
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace ProjectConfectionaryFactory.Repositories;
|
||||
namespace ProjectConfectioneryFactory.Repositories;
|
||||
|
||||
public interface IConnectionString
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
namespace ProjectConfectionaryFactory.Repositories.Implementations;
|
||||
namespace ProjectConfectioneryFactory.Repositories.Implementations;
|
||||
|
||||
internal class ConnectionString : IConnectionString
|
||||
{
|
||||
|
@ -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<int>(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";
|
||||
|
@ -6,7 +6,7 @@
|
||||
{
|
||||
"Name": "File",
|
||||
"Args": {
|
||||
"path": "Logs/confectionary_log.txt",
|
||||
"path": "Logs/confectionery_log.txt",
|
||||
"rollingInterval": "Day"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user