using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data.Objects;
using System.Data.EntityClient;


namespace GeekSpeakMVCRestPocoDemo.Data
{
	public class PocoContext : ObjectContext
	{
		public const string ConnectionString = "name=EFDemoEntities";
		public const string ContainerName = "EFDemoEntities";

		public PocoContext()
            : base(ConnectionString, ContainerName)
        {
            this.ContextOptions.LazyLoadingEnabled = true;
        }


		public ObjectSet<Poco.Address> Addresses
		{
			get { return _addresses ?? (_addresses = CreateObjectSet<Poco.Address>("Addresses")); }
		}
		private ObjectSet<Poco.Address> _addresses;

		public ObjectSet<Poco.Person> People
		{
			get { return _people ?? (_people = CreateObjectSet<Poco.Person>("People")); }
		}
		private ObjectSet<Poco.Person> _people;
	}
}
