Exemple #1
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="first"/> or <paramref name="second"/> is null.
        /// </exception>
        public AssociationRelationship AddAssociation(TypeBase first, TypeBase second)
        {
            AssociationRelationship association = new AssociationRelationship(first, second);

            AddAssociation(association);
            return(association);
        }
Exemple #2
0
        public AssociationRelationship Clone(TypeBase first, TypeBase second)
        {
            AssociationRelationship association = new AssociationRelationship(first, second);

            association.CopyFrom(this);
            return(association);
        }
Exemple #3
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="first"/> or <paramref name="second"/> is null.
        /// </exception>
        public AssociationRelationship AddAggregation(TypeBase first, TypeBase second)
        {
            AssociationRelationship aggregation = new AssociationRelationship(
                first, second, AssociationType.Aggregation);

            AddAssociation(aggregation);
            return(aggregation);
        }
Exemple #4
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="first"/> or <paramref name="second"/> is null.
        /// </exception>
        public AssociationRelationship AddComposition(TypeBase first, TypeBase second)
        {
            AssociationRelationship composition = new AssociationRelationship(
                first, second, AssociationType.Composition);

            AddAssociation(composition);
            return(composition);
        }
Exemple #5
0
        protected override void CopyFrom(Relationship relationship)
        {
            base.CopyFrom(relationship);

            AssociationRelationship association = (AssociationRelationship)relationship;

            associationType   = association.associationType;
            direction         = association.direction;
            startRole         = association.startRole;
            endRole           = association.endRole;
            startMultiplicity = association.startMultiplicity;
            endMultiplicity   = association.endMultiplicity;
        }
Exemple #6
0
 public bool InsertAssociation(AssociationRelationship associaton)
 {
     if (associaton != null && !relationships.Contains(associaton) &&
         entities.Contains(associaton.First) && entities.Contains(associaton.Second))
     {
         AddAssociation(associaton);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #7
0
 protected virtual void AddAssociation(AssociationRelationship association)
 {
     AddRelationship(association);
 }