PIbd-21_Zaharchenko_M.I._Pi.../Pizzeria/PizzeriaListImplement/DataListSingleton.cs

27 lines
732 B
C#
Raw Normal View History

2023-02-16 08:52:03 +04:00
using PizzeriaListImplement.Models;
2023-02-12 20:11:02 +04:00
2023-02-16 08:52:03 +04:00
namespace PizzeriaListImplement
2023-02-12 20:11:02 +04:00
{
public class DataListSingleton
{
private static DataListSingleton? _instance;
public List<Component> Components { get; set; }
public List<Order> Orders { get; set; }
2023-02-16 08:52:03 +04:00
public List<Pizza> Pizzas { get; set; }
2023-02-12 20:11:02 +04:00
private DataListSingleton()
{
Components = new List<Component>();
Orders = new List<Order>();
2023-02-16 08:52:03 +04:00
Pizzas = new List<Pizza>();
2023-02-12 20:11:02 +04:00
}
public static DataListSingleton GetInstance()
{
if (_instance == null)
{
_instance = new DataListSingleton();
}
return _instance;
}
}
}