ПИбд-22 Боровков М В 2 лабораторная работа #2

Closed
bekodeg wants to merge 20 commits from labWork2 into labWork1
Showing only changes of commit b441884b40 - Show all commits

View File

@ -27,8 +27,8 @@ namespace SushiBarFileImplement
private DataFileSingleton() private DataFileSingleton()
{ {
Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!; Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!;
Sushis = LoadData(SushiFileName, "Product", x => Sushi.Create(x)!)!; Sushis = LoadData(SushiFileName, "Sushi", x => Sushi.Create(x)!)!;
Orders = new List<Order>(); 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)
{ {