PIbd-23_Ivanov_V.N._Pizzeria/Pizzeria/PizzeriaListImplement/DataListSingleton.cs

34 lines
850 B
C#

using PizzeriaListImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PizzeriaListImplement
{
public class DataListSingleton
{
private static DataListSingleton? _instance;
public List<Component> Components { get; set; }
public List<Order> Orders { get; set; }
public List<Pizza> Pizzas { get; set; }
private DataListSingleton()
{
Components = new List<Component>();
Orders = new List<Order>();
Pizzas = new List<Pizza>();
}
public static DataListSingleton GetInstance()
{
if (_instance == null)
{
_instance = new DataListSingleton();
}
return _instance;
}
}
}