Exemple #1
0
 /// <summary>
 /// Remove a relationship from this relationship container
 /// </summary>
 /// <param name="association">The association to be removed</param>
 void IHasRelationships.RemoveRelationship(ITargetedAssociation association)
 {
     if (association is ActRelationship ar)
     {
         this.LoadProperty(o => o.Relationships).Remove(ar);
     }
     else
     {
         throw new InvalidOperationException($"Expected ActRelationship but got {association.GetType()}");
     }
 }
Exemple #2
0
 /// <summary>
 /// Add a relationship to this relationship container
 /// </summary>
 /// <param name="association">The association to be added</param>
 void IHasRelationships.AddRelationship(ITargetedAssociation association)
 {
     if (association is EntityRelationship er)
     {
         this.LoadProperty(o => o.Relationships).Add(er);
     }
     else
     {
         throw new InvalidOperationException($"Expected EntityRelationship but got {association.GetType()}");
     }
 }