PIbd-21_Raspaev_N.I._FoodOr.../FoodOrders/FoodOrdersListImplement/DataListSingleton.cs

26 lines
739 B
C#
Raw Normal View History

2023-02-07 13:00:02 +04:00
using FoodOrdersListImplement.Models;
namespace FoodOrdersListImplement
{
public class DataListSingleton
{
private static DataListSingleton? _instance;
public List<Dish> Dishes { get; set; }
public List<Order> Orders { get; set; }
public List<SetOfDishes> SetOfDishes { get; set; }
private DataListSingleton()
{
Dishes = new List<Dish>();
Orders = new List<Order>();
SetOfDishes = new List<SetOfDishes>();
}
public static DataListSingleton GetInstance()
{
if (_instance == null)
{
_instance = new DataListSingleton();
}
return _instance;
}
}
}