/// <summary>
            /// Initializes a new instance of the <see cref="PropertyConstraint"/> class.
            /// </summary>
            /// <param name="associationSet">The association set.</param>
            /// <param name="ordinal">The ordinal of the constraint in the <see cref="ReferentialConstraint"/> for the association set.</param>
            public PropertyConstraint(AssociationSet associationSet, int ordinal)
            {
                this.AssociationSet = associationSet;
                this.ordinal        = ordinal;

                AssociationSetEnd principalEnd = associationSet.Ends.Where(e => e.AssociationEnd == associationSet.AssociationType.ReferentialConstraint.PrincipalAssociationEnd).Single();

                this.PrincipalEntitySet = principalEnd.EntitySet;
                this.DependentEntitySet = associationSet.GetOtherEnd(principalEnd).EntitySet;
            }
        /// <summary>
        /// Initializes a new instance of the <see cref="RelationshipGroupEnd"/> class.
        /// </summary>
        /// <param name="associationSet">The association set.</param>
        /// <param name="associationSetEnd">The association set end.</param>
        public RelationshipGroupEnd(AssociationSet associationSet, AssociationSetEnd associationSetEnd)
        {
            this.EntitySet    = associationSetEnd.EntitySet;
            this.EntityType   = associationSetEnd.AssociationEnd.EntityType;
            this.Multiplicity = associationSet.GetOtherEnd(associationSetEnd).AssociationEnd.Multiplicity;

            this.associationSetEnds = new List <KeyValuePair <AssociationSet, AssociationSetEnd> >();
            this.associationSetEnds.Add(new KeyValuePair <AssociationSet, AssociationSetEnd>(associationSet, associationSetEnd));
            this.Candidates = new List <RelationshipCandidate>();

            this.CapacitySelector = CapacityRangeSelector.GetDefaultCapacityRangeSelector(this.Multiplicity);
        }