Переименование проекта
This commit is contained in:
parent
68a912864c
commit
a5a1099be9
@ -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
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace ProjectConfectionaryFactory.Repositories;
|
namespace ProjectConfectioneryFactory.Repositories;
|
||||||
|
|
||||||
public interface IConnectionString
|
public interface IConnectionString
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace ProjectConfectionaryFactory.Repositories.Implementations;
|
namespace ProjectConfectioneryFactory.Repositories.Implementations;
|
||||||
|
|
||||||
internal class ConnectionString : IConnectionString
|
internal class ConnectionString : IConnectionString
|
||||||
{
|
{
|
||||||
|
@ -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";
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
{
|
{
|
||||||
"Name": "File",
|
"Name": "File",
|
||||||
"Args": {
|
"Args": {
|
||||||
"path": "Logs/confectionary_log.txt",
|
"path": "Logs/confectionery_log.txt",
|
||||||
"rollingInterval": "Day"
|
"rollingInterval": "Day"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user