await QueuedTask.Run(() =>
{
using (NetworkSource junctionNetworkSource = telecomDomainNetwork.NetworkSources.FirstOrDefault(ns => ns.Name.Contains("TelcoDevice")))
using (NetworkSource edgeNetworkSource = telecomDomainNetwork.NetworkSources.FirstOrDefault(ns => ns.Name.Contains("TelcoEdgeObject")))
{
TelecomElement junction = utilityNetwork.CreateElement(junctionNetworkSource.GetAssetGroup("Fiber").GetAssetType("Fiber"),
new Guid("CCFCF5DE-5B90-4FD9-A459-2F2E88107532")) as TelecomElement;
TelecomElement edgeObject = utilityNetwork.CreateElement(edgeNetworkSource.GetAssetGroup("Fiber").GetAssetType("Fiber"),
new Guid("838B4A2B-8531-499D-8DCF-8567901D43D9")) as TelecomElement;
Association association = new Association(AssociationType.JunctionEdgeObjectConnectivityMidspan, junction, edgeObject, 0.3);
// Create the association from the port to the fiber.
geodatabase.ApplyEdits(() =>
{
utilityNetwork.AddAssociation(association);
});
// Delete the association
geodatabase.ApplyEdits(() =>
{
utilityNetwork.DeleteAssociation(association);
});
}
});