Method AddAssociationAsync
AddAssociationAsync(UtilityAssociation)
Adds an association between two utility elements in this utility network.
Declaration
public Task AddAssociationAsync(UtilityAssociation association)
Parameters
Type | Name | Description |
---|---|---|
UtilityAssociation | association | The association to add. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task that has no return value. One of the following exceptions may be set on the returned System.Threading.Tasks.Task:
|
Remarks
Adding an association may also update the features that participate in the association.
Use CanAddAssociationAsync(UtilityAssociation) to determine if you can successfully add this association.
This method requires that:
- The association type is supported by the utility network schema. Note that SchemaVersion less than 4 does not support the following association types:
- The association elements are accessible. Use IsValid to check feature accessibility to ensure it has not been filtered out.
- The FromElement has the necessary role for the association type. A Container can participate in a containment association or a Structure can participate in a structural attachment association.
- If the association's type is Connectivity, the Terminal must be set for elements with more than one terminal available in the Terminals
- The association is supported by a utility rule. Use GetRulesAsync(IEnumerable<UtilityAssetType>, CancellationToken) to determine if the AssociationType can be made between the FromElement and ToElement using their corresponding AssetType.
See Also
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 200.5 |
.NET | 200.5 |
.NET Windows | 200.5 |
.NET Android | 200.5 |
.NET iOS | 200.5 |
.NET Framework | 200.5 |
UWP | 200.5 |