6 instantiations of NetworkIdentifier
Aspire.Hosting (4)
ApplicationModel\Network.cs (3)
19public static readonly NetworkIdentifier LocalhostNetwork = new NetworkIdentifier("localhost"); 24public static readonly NetworkIdentifier PublicInternet = new NetworkIdentifier("."); 29public static readonly NetworkIdentifier DefaultAspireContainerNetwork = new NetworkIdentifier("aspire-container-network");
Dcp\DcpModelUtilities.cs (1)
319var networkId = new NetworkIdentifier(ts.ContainerNetworkName!);
Aspire.Hosting.DevTunnels.Tests (1)
DevTunnelResourceBuilderExtensionsTests.cs (1)
648var containerNetwork = new NetworkIdentifier("container-network");
Aspire.Hosting.Testing (1)
DistributedApplicationHostingTestingExtensions.cs (1)
249return app.GetEndpointForNetwork(resourceName, networkIdentifier is null ? null : new NetworkIdentifier(networkIdentifier), endpointName);
51 references to NetworkIdentifier
Aspire.Hosting (43)
ApplicationModel\AllocatedEndpoint.cs (2)
54NetworkIdentifier? networkId = null 142public NetworkIdentifier NetworkID { get; private set; }
ApplicationModel\ContainerNetworkAliasAnnotation.cs (2)
19private NetworkIdentifier _network = KnownNetworkIdentifiers.DefaultAspireContainerNetwork; 41public NetworkIdentifier Network
ApplicationModel\EndpointAnnotation.cs (10)
29private readonly NetworkIdentifier _networkId; 112NetworkIdentifier? networkId, 161NetworkIdentifier? networkId, 341public NetworkIdentifier DefaultNetworkID => _networkId; 399public record class NetworkEndpointSnapshot(ValueSnapshot<AllocatedEndpoint> Snapshot, NetworkIdentifier NetworkID); 426public bool TryAdd(NetworkIdentifier networkId, ValueSnapshot<AllocatedEndpoint> snapshot) 442public void AddOrUpdateAllocatedEndpoint(NetworkIdentifier networkId, AllocatedEndpoint endpoint) 455public Task<AllocatedEndpoint> GetAllocatedEndpointAsync(NetworkIdentifier networkId, CancellationToken cancellationToken = default) 461internal bool TryGetAllocatedEndpoint(NetworkIdentifier networkId, [NotNullWhen(true)] out AllocatedEndpoint? endpoint) 479private NetworkEndpointSnapshot GetSnapshotFor(NetworkIdentifier networkId)
ApplicationModel\EndpointReference.cs (7)
19private readonly NetworkIdentifier? _contextNetworkId; 132public NetworkIdentifier? ContextNetworkID => _contextNetworkId; 258/// or host processes calling container via mapped ports). If a <see cref="NetworkIdentifier"/> is specified, the <see cref="EndpointReference"/> 259/// will always resolve in the context of that network. If the <see cref="NetworkIdentifier"/> is null, the reference will attempt to resolve itself 262public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint, NetworkIdentifier? contextNetworkId) 294public EndpointReference(IResourceWithEndpoints owner, string endpointName, NetworkIdentifier? contextNetworkId = null) 361var networkContext = Endpoint.ContextNetworkID ?? context.GetNetworkIdentifier();
ApplicationModel\EndpointReferenceAnnotation.cs (1)
32public NetworkIdentifier ContextNetworkId { get; set; } = KnownNetworkIdentifiers.LocalhostNetwork;
ApplicationModel\HostUrl.cs (1)
26var networkContext = context.GetNetworkIdentifier();
ApplicationModel\IValueProvider.cs (1)
24public NetworkIdentifier? Network { get; init; }
ApplicationModel\Network.cs (3)
19public static readonly NetworkIdentifier LocalhostNetwork = new NetworkIdentifier("localhost"); 24public static readonly NetworkIdentifier PublicInternet = new NetworkIdentifier("."); 29public static readonly NetworkIdentifier DefaultAspireContainerNetwork = new NetworkIdentifier("aspire-container-network");
ApplicationModel\ResourceExtensions.cs (4)
575internal static NetworkIdentifier GetDefaultResourceNetwork(this IResource resource) 580internal static IEnumerable<NetworkIdentifier> GetSupportedNetworks(this IResource resource) 773public static IEnumerable<EndpointReference> GetEndpoints(this IResourceWithEndpoints resource, NetworkIdentifier contextNetworkId) 813public static EndpointReference GetEndpoint(this IResourceWithEndpoints resource, string endpointName, NetworkIdentifier contextNetworkId)
ApplicationModel\ResourceUrlsCallbackContext.cs (1)
45public EndpointReference? GetEndpoint(string name, NetworkIdentifier contextNetworkId) =>
ApplicationModel\ValueProviderExtensions.cs (1)
8public static NetworkIdentifier GetNetworkIdentifier(this ValueProviderContext context)
Dcp\DcpModelUtilities.cs (1)
319var networkId = new NetworkIdentifier(ts.ContainerNetworkName!);
Dcp\DcpNameGenerator.cs (2)
109public (string, bool) GetServiceName(IResource resource, EndpointAnnotation endpoint, NetworkIdentifier targetNetworkId) 176private static string NetworkServiceKey(IResource resource, EndpointAnnotation endpoint, NetworkIdentifier targetNetworkId)
ResourceBuilderExtensions.cs (7)
1543/// Exposes an endpoint on a resource. A reference to this endpoint can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string, NetworkIdentifier)"/>. 1620/// Exposes an endpoint on a resource. A reference to this endpoint can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string, NetworkIdentifier)"/>. 1705/// Exposes an endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string, NetworkIdentifier)"/>. 1730/// Exposes an endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string, NetworkIdentifier)"/>. 1756/// This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string, NetworkIdentifier)"/>. 1804/// This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string, NetworkIdentifier)"/>. 1889public static EndpointReference GetEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string name, NetworkIdentifier contextNetworkId) where T : IResourceWithEndpoints
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
907var networkId = endpoint.ContextNetworkID ?? KnownNetworkIdentifiers.LocalhostNetwork;
Aspire.Hosting.DevTunnels.Tests (1)
DevTunnelResourceBuilderExtensionsTests.cs (1)
648var containerNetwork = new NetworkIdentifier("container-network");
Aspire.Hosting.Testing (3)
DistributedApplicationHostingTestingExtensions.cs (3)
228public static Uri GetEndpointForNetwork(this DistributedApplication app, string resourceName, NetworkIdentifier? networkIdentifier, string? endpointName = default) 265static string GetEndpointUriStringCore(DistributedApplication app, string resourceName, string? endpointName = default, NetworkIdentifier? networkIdentifier = default) 302static EndpointReference? GetEndpointOrDefault(IResourceWithEndpoints resourceWithEndpoints, string endpointName, NetworkIdentifier? networkIdentifier = default)
Aspire.Hosting.Tests (3)
Dcp\DcpExecutorTests.cs (1)
9019async ValueTask AssertEndpoint(IResourceWithEndpoints resource, string name, NetworkIdentifier network, string address, int port)
EndpointReferenceTests.cs (1)
338var network = source.GetDefaultResourceNetwork();
WithEndpointTests.cs (1)
91typeof(NetworkIdentifier),