29 lines
770 B
C#
29 lines
770 B
C#
|
using DinerListImplement.Models;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace DinerListImplement
|
|||
|
{
|
|||
|
internal class DataListSingleton
|
|||
|
{
|
|||
|
public static DataListSingleton? _instance;
|
|||
|
|
|||
|
public List<Food>? Foods { get; set; }
|
|||
|
public List<Snack>? Snacks { get; set; }
|
|||
|
public List<Order>? Orders { get; set; }
|
|||
|
|
|||
|
private DataListSingleton() {
|
|||
|
Foods = new List<Food>();
|
|||
|
Snacks = new List<Snack>();
|
|||
|
Orders = new List<Order>();
|
|||
|
}
|
|||
|
public static DataListSingleton GetInstance() {
|
|||
|
if (_instance == null) _instance = new DataListSingleton();
|
|||
|
return _instance;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|