using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DemoMasterDetails.Model;

namespace DemoMasterDetails.ViewModel
{
    public class ViewModel : IDisposable
    {
        public ViewModel()
        {
            OrderInfoRepository order = new OrderInfoRepository();
            OrdersInfo = order.GetOrdersInfo(20);
            OrderDetails = order.GetOrderDetails(20);
        }

        private List<OrderInfo> _ordersInfo;
        private List<OrderDetails> _orderDetails;

        public List<OrderInfo> OrdersInfo
        {
            get { return _ordersInfo; }
            set { _ordersInfo = value; }
        }

        public List<OrderDetails> OrderDetails
        {
            get { return _orderDetails; }
            set { _orderDetails = value; }
        }

        public void Dispose()
        {
            if (OrdersInfo != null)
                OrdersInfo.Clear();
        }
    }
}
