public CsdlSemanticsEntitySet(CsdlSemanticsEntityContainer container, CsdlEntitySet entitySet) : base(entitySet)
		{
			this.elementTypeCache = new Cache<CsdlSemanticsEntitySet, IEdmEntityType>();
			this.navigationTargetsCache = new Cache<CsdlSemanticsEntitySet, IEnumerable<IEdmNavigationTargetMapping>>();
			this.container = container;
			this.entitySet = entitySet;
		}
		public IEdmEntitySet FindNavigationTarget(IEdmNavigationProperty property)
		{
			IEdmEntitySet entitySet;
			CsdlSemanticsNavigationProperty csdlSemanticsNavigationProperty = property as CsdlSemanticsNavigationProperty;
			if (csdlSemanticsNavigationProperty != null)
			{
				IEnumerator<IEdmEntityContainer> enumerator = this.Model.EntityContainers().GetEnumerator();
				using (enumerator)
				{
					while (enumerator.MoveNext())
					{
						CsdlSemanticsEntityContainer current = (CsdlSemanticsEntityContainer)enumerator.Current;
						IEnumerable<CsdlSemanticsAssociationSet> csdlSemanticsAssociationSets = current.FindAssociationSets(csdlSemanticsNavigationProperty.Association);
						if (csdlSemanticsAssociationSets == null)
						{
							continue;
						}
						IEnumerator<CsdlSemanticsAssociationSet> enumerator1 = csdlSemanticsAssociationSets.GetEnumerator();
						using (enumerator1)
						{
							while (enumerator1.MoveNext())
							{
								CsdlSemanticsAssociationSet csdlSemanticsAssociationSet = enumerator1.Current;
								CsdlSemanticsAssociationSetEnd end1 = csdlSemanticsAssociationSet.End1 as CsdlSemanticsAssociationSetEnd;
								CsdlSemanticsAssociationSetEnd end2 = csdlSemanticsAssociationSet.End2 as CsdlSemanticsAssociationSetEnd;
								if (csdlSemanticsAssociationSet.End1.EntitySet != this || csdlSemanticsNavigationProperty.To != csdlSemanticsAssociationSet.End2.Role)
								{
									if (csdlSemanticsAssociationSet.End2.EntitySet != this || csdlSemanticsNavigationProperty.To != csdlSemanticsAssociationSet.End1.Role)
									{
										continue;
									}
									this.Model.SetAssociationSetName(csdlSemanticsAssociationSet.End2.EntitySet, property, csdlSemanticsAssociationSet.Name);
									if (end1 != null && end2 != null)
									{
										this.Model.SetAssociationSetAnnotations(end2.EntitySet, property, csdlSemanticsAssociationSet.DirectValueAnnotations, end2.DirectValueAnnotations, end1.DirectValueAnnotations);
									}
									entitySet = csdlSemanticsAssociationSet.End1.EntitySet;
									return entitySet;
								}
								else
								{
									this.Model.SetAssociationSetName(csdlSemanticsAssociationSet.End1.EntitySet, property, csdlSemanticsAssociationSet.Name);
									if (end1 != null && end2 != null)
									{
										this.Model.SetAssociationSetAnnotations(end1.EntitySet, property, csdlSemanticsAssociationSet.DirectValueAnnotations, end1.DirectValueAnnotations, end2.DirectValueAnnotations);
									}
									entitySet = csdlSemanticsAssociationSet.End2.EntitySet;
									return entitySet;
								}
							}
						}
					}
					return null;
				}
				return entitySet;
			}
			return null;
		}