public static AssociationEndMember GetOtherAssociationEnd(
				this ObjectStateEntry entry, AssociationEndMember end)
		{
			end.ValidateBelongsTo(entry);
			AssociationEndMember[] ends = entry.GetAssociationEnds();
			if (ends[0] == end)
			{
				return ends[1];
			}
			return ends[0];
		}
		public static NavigationProperty GetNavigationProperty(this ObjectStateEntry entry, AssociationEndMember end)
		{
			end.ValidateBelongsTo(entry);

			var otherEnd = entry.GetOtherAssociationEnd(end);
			var relationshipType = entry.EntitySet.ElementType;

            EntityType elementType = GetInheritedEntityTypeByEntityName(entry, end.Name);
		    NavigationProperty property =
		        elementType.NavigationProperties.SingleOrDefault(p => p.RelationshipType == relationshipType &&
		                                                              p.FromEndMember == end && p.ToEndMember == otherEnd);
		    return property;
		}
		public static EntityKey GetEndEntityKey(this ObjectStateEntry entry, AssociationEndMember end)
		{
			end.ValidateBelongsTo(entry);

			AssociationEndMember[] ends = entry.GetAssociationEnds();

			if (ends[0] == end)
			{
				return entry.UsableValues()[0] as EntityKey;
			}

			return entry.UsableValues()[1] as EntityKey;
		}