Внедрена файловая реализация в программу

This commit is contained in:
Данияр Аглиуллов 2023-02-15 04:03:18 +04:00
parent 2a0c31d5c0
commit 9e8a3d4e87
3 changed files with 5 additions and 6 deletions

View File

@ -27,10 +27,8 @@ namespace ConfectioneryFileImplement
private DataFileSingleton() private DataFileSingleton()
{ {
Components = LoadData(ComponentFileName, "Component", x => Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!;
Component.Create(x)!)!; Pastries = LoadData(PastryFileName, "Pastry", x => Pastry.Create(x)!)!;
Pastries = LoadData(PastryFileName, "Pastry", x =>
Pastry.Create(x)!)!;
Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!; Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!;
} }
private static List<T>? LoadData<T>(string filename, string xmlNodeName, Func<XElement, T> selectFunction) private static List<T>? LoadData<T>(string filename, string xmlNodeName, Func<XElement, T> selectFunction)

View File

@ -15,6 +15,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ConfectionaryBusinessLogic\ConfectioneryBusinessLogic.csproj" /> <ProjectReference Include="..\ConfectionaryBusinessLogic\ConfectioneryBusinessLogic.csproj" />
<ProjectReference Include="..\ConfectionaryFileImplement\ConfectioneryFileImplement.csproj" />
<ProjectReference Include="..\ConfectionaryListImplement\ConfectioneryListImplement.csproj" /> <ProjectReference Include="..\ConfectionaryListImplement\ConfectioneryListImplement.csproj" />
<ProjectReference Include="..\ConfectioneryContracts\ConfectioneryContracts.csproj" /> <ProjectReference Include="..\ConfectioneryContracts\ConfectioneryContracts.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -1,8 +1,8 @@
using ConfectioneryListImplement.Implements; using ConfectioneryFileImplement.Implements;
using ConfectioneryBusinessLogic.BusinessLogics; using ConfectioneryBusinessLogic.BusinessLogics;
using ConfectioneryContracts.BusinessLogicsContracts; using ConfectioneryContracts.BusinessLogicsContracts;
using ConfectioneryContracts.StoragesContract; using ConfectioneryContracts.StoragesContract;
using ConfectioneryListImplement; using ConfectioneryFileImplement;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging; using NLog.Extensions.Logging;