public TerritoriesCollectionProxyStub Territories_LoadAll()
		{
			TerritoriesCollection coll = new TerritoriesCollection();
			if (coll.LoadAll())
			{
				return coll;
			}

			return null;
		}		
		public TerritoriesCollectionProxyStub Territories_QueryForCollection(string serializedQuery)
		{
			TerritoriesQuery query = TerritoriesQuery.SerializeHelper.FromXml(
				serializedQuery, typeof(TerritoriesQuery), AllKnownTypes) as TerritoriesQuery;

			TerritoriesCollection coll = new TerritoriesCollection();
			if (coll.Load(query))
			{
				return coll;
			}

			return null;
		}
		public TerritoriesCollection Territories_LoadByDynamic(string serializedQuery)
		{
			TerritoriesQuery query = TerritoriesQuery.SerializeHelper.FromXml(
				serializedQuery, typeof(TerritoriesQuery), AllKnownTypes) as TerritoriesQuery;

			TerritoriesCollection coll = new TerritoriesCollection();
			coll.es.IsLazyLoadDisabled = true;
			coll.Load(query);
			return coll;
		}
		public TerritoriesCollection Territories_LoadAll()
		{
			TerritoriesCollection coll = new TerritoriesCollection();
			coll.es.IsLazyLoadDisabled = true;
			coll.LoadAll();
			return coll;
		}
		public jsResponse<TerritoriesCollection, Territories> TerritoriesCollection_Save(TerritoriesCollection collection)
		{
			jsResponse<TerritoriesCollection, Territories> response = new jsResponse<TerritoriesCollection, Territories>();

			try
			{
				collection.Save();
				response.collection = collection;
			}
			catch (Exception ex)
			{
				response.exception = ex.Message;
			}

			return response;
		}
		public jsResponse<TerritoriesCollection, Territories> TerritoriesCollection_LoadAll()
		{
			jsResponse<TerritoriesCollection, Territories> response = new jsResponse<TerritoriesCollection, Territories>();

			try
			{
				TerritoriesCollection collection = new TerritoriesCollection();
				collection.LoadAll();
				response.collection = collection;
			}
			catch (Exception ex)
			{
				response.exception = ex.Message;
			}

			return response;
		}