using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections;
using System.Collections.Generic;


namespace Hierarchy_RIA.Web
{
	public class MyDataContext
	{
		static NWDomainContext _domainContext;

		public static NWDomainContext DomainContext
		{
			get
			{
				if (_domainContext == null)
				{
					_domainContext = new NWDomainContext();
				}
				return _domainContext;
			}
		}

		bool ordersLoaded = false;
		public IEnumerable<Order> Orders
		{
			get
			{
				if (!ordersLoaded)
				{
					DomainContext.Load(DomainContext.GetOrdersQuery());
					ordersLoaded = true;
				}
				return DomainContext.Orders;
			}
		}
	}
}
