Presnyakova V.V Lab_2 #2
@ -29,14 +29,12 @@ namespace JewelryStoreFileImplement
|
||||
"Components", x => x.GetXElement);
|
||||
public void SaveProducts() => SaveData(Products, ProductFileName,
|
||||
"Products", x => x.GetXElement);
|
||||
public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x
|
||||
=> x.GetXElement);
|
||||
public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement);
|
||||
private DataFileSingleton()
|
||||
{
|
||||
Components = LoadData(ComponentFileName, "Component", x =>
|
||||
Component.Create(x)!)!;
|
||||
Products = LoadData(ProductFileName, "Product", x =>
|
||||
Product.Create(x)!)!;
|
||||
Products = LoadData(ProductFileName, "Product", x => Jewel.Create(x)!)!;
|
||||
Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!;
|
||||
}
|
||||
private static List<T>? LoadData<T>(string filename, string xmlNodeName,
|
||||
|
Loading…
Reference in New Issue
Block a user