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