35 instantiations of EndpointReference
Aspire.Hosting (4)
ApplicationModel\ResourceExtensions.cs (2)
515return endpoints.Select(e => new EndpointReference(resource, e)); 530return new EndpointReference(resource, endpointName);
Orchestrator\ApplicationOrchestrator.cs (1)
215var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = new EndpointReference(resourceWithEndpoints, endpoint) };
ResourceBuilderExtensions.cs (1)
707var endpointReference = new EndpointReference(resourceWithEndpoints, annotation);
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBResource.cs (1)
25internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsResource.cs (1)
41internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusResource.cs (1)
31internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.SignalR (1)
AzureSignalRResource.cs (1)
18internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.Storage (3)
AzureStorageResource.cs (3)
22private EndpointReference EmulatorBlobEndpoint => new(this, "blob"); 23private EndpointReference EmulatorQueueEndpoint => new(this, "queue"); 24private EndpointReference EmulatorTableEndpoint => new(this, "table");
Aspire.Hosting.Azure.Tests (1)
AzureStorageExtensionsTests.cs (1)
417=> new(storage.Resource, new EndpointAnnotation(ProtocolType.Tcp, name: name, targetPort: port));
Aspire.Hosting.Docker (2)
DockerComposeAspireDashboardResource.cs (2)
18public EndpointReference PrimaryEndpoint => new(this, "http"); 23public EndpointReference OtlpGrpcEndpoint => new(this, "otlp-grpc");
Aspire.Hosting.Garnet (1)
GarnetResource.cs (1)
29public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.Kafka (2)
KafkaServerResource.cs (2)
26public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName); 32public EndpointReference InternalEndpoint => _internalEndpoint ??= new(this, InternalEndpointName);
Aspire.Hosting.Milvus (1)
MilvusServerResource.cs (1)
36public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.MongoDB (1)
MongoDBServerResource.cs (1)
34public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.MySql (1)
MySqlServerResource.cs (1)
25PrimaryEndpoint = new(this, PrimaryEndpointName);
Aspire.Hosting.Nats (1)
NatsServerResource.cs (1)
33public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.Oracle (1)
OracleDatabaseServerResource.cs (1)
22PrimaryEndpoint = new(this, PrimaryEndpointName);
Aspire.Hosting.PostgreSQL (2)
PgWebContainerResource.cs (1)
21public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
PostgresServerResource.cs (1)
24PrimaryEndpoint = new(this, PrimaryEndpointName);
Aspire.Hosting.Qdrant (2)
QdrantServerResource.cs (2)
36public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName); 41public EndpointReference HttpEndpoint => _httpEndpoint ??= new(this, HttpEndpointName);
Aspire.Hosting.RabbitMQ (1)
RabbitMQServerResource.cs (1)
25PrimaryEndpoint = new(this, PrimaryEndpointName);
Aspire.Hosting.Redis (2)
RedisInsightResource.cs (1)
21public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
RedisResource.cs (1)
32public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.Seq (1)
SeqResource.cs (1)
19public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.SqlServer (1)
SqlServerServerResource.cs (1)
22PrimaryEndpoint = new(this, PrimaryEndpointName);
Aspire.Hosting.Tests (3)
ExpressionResolverTests.cs (3)
194PrimaryEndpoint = new(this, "http"); 214EndpointReference Endpoint1 => new(this, "endpoint1"); 215EndpointReference Endpoint2 => new(this, "endpoint2");
Aspire.Hosting.Valkey (1)
ValkeyResource.cs (1)
34public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
160 references to EndpointReference
Aspire.Hosting (45)
ApplicationModel\EndpointReference.cs (5)
115/// Creates a new instance of <see cref="EndpointReference"/> with the specified endpoint name. 130/// Creates a new instance of <see cref="EndpointReference"/> with the specified endpoint name. 149public class EndpointReferenceExpression(EndpointReference endpointReference, EndpointProperty property) : IManifestExpressionProvider, IValueProvider, IValueWithReferences 152/// Gets the <see cref="EndpointReference"/>. 154public EndpointReference Endpoint { get; } = endpointReference ?? throw new ArgumentNullException(nameof(endpointReference));
ApplicationModel\ExpressionResolver.cs (3)
19static string EndpointUniqueName(EndpointReference endpointReference) => $"{endpointReference.Resource.Name}/{endpointReference.EndpointName}"; 25async Task<string?> EvalEndpointAsync(EndpointReference endpointReference, EndpointProperty property) 181EndpointReference endpointReference when sourceIsContainer => new ResolvedValue(await EvalEndpointAsync(endpointReference, EndpointProperty.Url).ConfigureAwait(false), false),
ApplicationModel\HttpCommandContext.cs (4)
9/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?, HttpCommandOptions?)"/>. 26public required EndpointReference Endpoint { get; init; } 47/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?, HttpCommandOptions?)"/>. 64public required EndpointReference Endpoint { get; init; }
ApplicationModel\HttpCommandOptions.cs (1)
16public Func<EndpointReference>? EndpointSelector { get; set; }
ApplicationModel\ProjectResource.cs (1)
25internal bool ShouldInjectEndpointEnvironment(EndpointReference e)
ApplicationModel\ResourceExtensions.cs (4)
510/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 511public static IEnumerable<EndpointReference> GetEndpoints(this IResourceWithEndpoints resource) 526/// <returns>An <see cref="EndpointReference"/> object representing the endpoint reference 528public static EndpointReference GetEndpoint(this IResourceWithEndpoints resource, string endpointName)
ApplicationModel\ResourceUrlAnnotation.cs (2)
27public EndpointReference? Endpoint { get; init; } 41internal ResourceUrlAnnotation WithEndpoint(EndpointReference endpoint)
ApplicationModel\ResourceUrlsCallbackContext.cs (1)
29public EndpointReference? GetEndpoint(string name) =>
ProjectResourceBuilderExtensions.cs (3)
747foreach (var e in builder.Resource.GetEndpoints().Where(builder.Resource.ShouldInjectEndpointEnvironment)) 796foreach (var e in builder.Resource.GetEndpoints().Where(builder.Resource.ShouldInjectEndpointEnvironment)) 827foreach (var e in builder.Resource.GetEndpoints().Where(builder.Resource.ShouldInjectEndpointEnvironment))
ResourceBuilderExtensions.cs (21)
143public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, EndpointReference endpointReference) 408foreach (var endpoint in annotation.Resource.GetEndpoints()) 562public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, EndpointReference endpointReference) 707var endpointReference = new EndpointReference(resourceWithEndpoints, annotation); 805/// Gets an <see cref="EndpointReference"/> by name from the resource. These endpoints are declared either using <see cref="WithEndpoint{T}(IResourceBuilder{T}, int?, int?, string?, string?, string?, bool, bool?, ProtocolType?)"/> or by launch settings (for project resources). 806/// The <see cref="EndpointReference"/> can be used to resolve the address of the endpoint in <see cref="WithEnvironment{T}(IResourceBuilder{T}, Action{EnvironmentCallbackContext})"/>. 811/// <returns>An <see cref="EndpointReference"/> that can be used to resolve the address of the endpoint after resource allocation has occurred.</returns> 812public static EndpointReference GetEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string name) where T : IResourceWithEndpoints 974var endpoint = url.ValueProviders.OfType<EndpointReference>().FirstOrDefault(); 994/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference, ResourceUrlAnnotation})"/>. 1067public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference, ResourceUrlAnnotation> callback) 1072var endpoint = builder.GetEndpoint(endpointName); 1410public static IResourceBuilder<T> WithHttpHealthCheck<T>(this IResourceBuilder<T> builder, Func<EndpointReference>? endpointSelector, string? path = null, int? statusCode = null) where T : IResourceWithEndpoints 1414var endpoint = endpointSelector() 1759Func<EndpointReference>? endpointSelector, 1766var endpoint = endpointSelector() 1864private static Func<EndpointReference> NamedEndpointSelector<TResource>(IResourceBuilder<TResource> builder, string[] endpointNames, string errorDisplayNoun) 1870EndpointReference? matchingEndpoint = null; 1890private static Func<EndpointReference> DefaultEndpointSelector<TResource>(IResourceBuilder<TResource> builder) 1896EndpointReference? matchingEndpoint = null;
Aspire.Hosting.Azure (6)
AzureBicepResourceExtensions.cs (1)
301public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, EndpointReference value)
AzureProvisioningResourceExtensions.cs (4)
205/// The <see cref="EndpointReference"/> to use for the value of the <see cref="ProvisioningParameter"/>. 213/// This is useful when assigning a <see cref="BicepValue"/> to the value of an Aspire <see cref="EndpointReference"/>. 215public static ProvisioningParameter AsProvisioningParameter(this EndpointReference endpointReference, AzureResourceInfrastructure infrastructure, string parameterName) 239/// This is useful when assigning a <see cref="BicepValue"/> to the value of an Aspire <see cref="EndpointReference"/>.
AzureResourcePreparer.cs (1)
401if (value is string or EndpointReference or ParameterResource or EndpointReferenceExpression or HostUrl)
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppContext.cs (1)
529if (value is EndpointReference ep)
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceWebsiteContext.cs (1)
115if (value is EndpointReference ep)
Aspire.Hosting.Azure.CosmosDB (2)
AzureCosmosDBEmulatorConnectionString.cs (1)
11public static ReferenceExpression Create(EndpointReference endpoint, bool isPreviewEmulator) =>
AzureCosmosDBResource.cs (1)
25internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.EventHubs (3)
AzureEventHubsExtensions.cs (2)
260var blobEndpoint = storage.GetEndpoint("blob"); 261var tableEndpoint = storage.GetEndpoint("table");
AzureEventHubsResource.cs (1)
41internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.Functions (2)
AzureFunctionsProjectResourceExtensions.cs (2)
109var endpoint = resource.GetEndpoint("http"); 195var targetEndpoint = builder.Resource.GetEndpoint(useHttps ? "https" : "http");
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (1)
381var sqlEndpoint = sqlEdgeResource.Resource.GetEndpoint("tcp");
AzureServiceBusResource.cs (1)
31internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.SignalR (1)
AzureSignalRResource.cs (1)
18internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.Storage (7)
AzureStorageEmulatorConnectionString.cs (4)
13public static ReferenceExpression Create(EndpointReference? blobEndpoint = null, EndpointReference? queueEndpoint = null, EndpointReference? tableEndpoint = null) 33static void AppendEndpointExpression(ReferenceExpressionBuilder builder, string key, EndpointReference endpoint)
AzureStorageResource.cs (3)
22private EndpointReference EmulatorBlobEndpoint => new(this, "blob"); 23private EndpointReference EmulatorQueueEndpoint => new(this, "queue"); 24private EndpointReference EmulatorTableEndpoint => new(this, "table");
Aspire.Hosting.Azure.Tests (13)
AzureContainerAppsTests.cs (6)
300var httpEp = project.GetEndpoint("http"); 301var httpsEp = project.GetEndpoint("https"); 302var internalEp = project.GetEndpoint("internal"); 377var httpEp = project.GetEndpoint("http"); 378var httpsEp = project.GetEndpoint("https"); 379var internalEp = project.GetEndpoint("internal");
AzureCosmosDBExtensionsTests.cs (1)
84var endpoint = cosmos.GetEndpoint("data-explorer");
AzureProvisioningResourceExtensionsTests.cs (1)
20var endpointReference = apiProject.GetEndpoint("https");
AzureStorageExtensionsTests.cs (1)
416EndpointReference GetEndpointReference(string name, int port)
src\Aspire.Hosting.Azure.Storage\AzureStorageEmulatorConnectionString.cs (4)
13public static ReferenceExpression Create(EndpointReference? blobEndpoint = null, EndpointReference? queueEndpoint = null, EndpointReference? tableEndpoint = null) 33static void AppendEndpointExpression(ReferenceExpressionBuilder builder, string key, EndpointReference endpoint)
Aspire.Hosting.Docker (6)
DockerComposeAspireDashboardResource.cs (2)
18public EndpointReference PrimaryEndpoint => new(this, "http"); 23public EndpointReference OtlpGrpcEndpoint => new(this, "otlp-grpc");
DockerComposeEnvironmentContext.cs (1)
133.Where(kvp => kvp.Value is EndpointReference epRef && epRef.Scheme == "https" && kvp.Key.StartsWith("services__"))
DockerComposeInfrastructure.cs (2)
53if (environment.DashboardEnabled && environment.Dashboard?.Resource.OtlpGrpcEndpoint is EndpointReference otlpGrpcEndpoint) 81private static void ConfigureOtlp(IResource resource, EndpointReference otlpEndpoint)
DockerComposeServiceResourceExtensions.cs (1)
20if (value is EndpointReference ep)
Aspire.Hosting.Garnet (2)
GarnetResource.cs (2)
24private EndpointReference? _primaryEndpoint; 29public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.Kafka (8)
KafkaBuilderExtensions.cs (4)
119var endpoint = kafkaResource.InternalEndpoint; 134static void ConfigureKafkaUIContainer(EnvironmentCallbackContext context, EndpointReference endpoint, int index) 210var primaryEndpoint = resource.PrimaryEndpoint; 212var internalEndpoint = resource.InternalEndpoint;
KafkaServerResource.cs (4)
19private EndpointReference? _primaryEndpoint; 20private EndpointReference? _internalEndpoint; 26public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName); 32public EndpointReference InternalEndpoint => _internalEndpoint ??= new(this, InternalEndpointName);
Aspire.Hosting.Kubernetes (1)
KubernetesServiceResourceExtensions.cs (1)
22if (value is EndpointReference ep)
Aspire.Hosting.Milvus (2)
MilvusServerResource.cs (2)
26private EndpointReference? _primaryEndpoint; 36public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.MongoDB (2)
MongoDBServerResource.cs (2)
17private EndpointReference? _primaryEndpoint; 34public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.MySql (3)
MySqlBuilderExtensions.cs (2)
221var endpoint = singleInstance.PrimaryEndpoint; 362var endpoint = mySqlInstance.PrimaryEndpoint;
MySqlServerResource.cs (1)
32public EndpointReference PrimaryEndpoint { get; }
Aspire.Hosting.Nats (2)
NatsServerResource.cs (2)
16private EndpointReference? _primaryEndpoint; 33public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.Oracle (1)
OracleDatabaseServerResource.cs (1)
29public EndpointReference PrimaryEndpoint { get; }
Aspire.Hosting.PostgreSQL (4)
PgWebContainerResource.cs (2)
16private EndpointReference? _primaryEndpoint; 21public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
PostgresBuilderExtensions.cs (1)
533var endpoint = postgresInstance.PrimaryEndpoint;
PostgresServerResource.cs (1)
32public EndpointReference PrimaryEndpoint { get; }
Aspire.Hosting.Qdrant (4)
QdrantServerResource.cs (4)
25private EndpointReference? _primaryEndpoint; 26private EndpointReference? _httpEndpoint; 36public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName); 41public EndpointReference HttpEndpoint => _httpEndpoint ??= new(this, HttpEndpointName);
Aspire.Hosting.RabbitMQ (1)
RabbitMQServerResource.cs (1)
33public EndpointReference PrimaryEndpoint { get; }
Aspire.Hosting.Redis (4)
RedisInsightResource.cs (2)
16private EndpointReference? _primaryEndpoint; 21public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
RedisResource.cs (2)
27private EndpointReference? _primaryEndpoint; 32public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.Redis.Tests (2)
RedisFunctionalTests.cs (2)
85var endpoint = redis.GetEndpoint("tcp"); 619var endpoint = redisCommander.GetEndpoint("http");
Aspire.Hosting.Seq (2)
SeqResource.cs (2)
14private EndpointReference? _primaryEndpoint; 19public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.SqlServer (1)
SqlServerServerResource.cs (1)
29public EndpointReference PrimaryEndpoint { get; }
Aspire.Hosting.Testing (3)
DistributedApplicationHostingTestingExtensions.cs (3)
99EndpointReference? endpoint; 126static EndpointReference? GetEndpointOrDefault(IResourceWithEndpoints resourceWithEndpoints, string endpointName) 128var reference = resourceWithEndpoints.GetEndpoint(endpointName);
Aspire.Hosting.Tests (14)
ExpressionResolverTests.cs (3)
197public EndpointReference PrimaryEndpoint { get; } 214EndpointReference Endpoint1 => new(this, "endpoint1"); 215EndpointReference Endpoint2 => new(this, "endpoint2");
ProjectResourceTests.cs (2)
632var http = resource.GetEndpoint("http"); 633var https = resource.GetEndpoint("https");
WithEndpointTests.cs (3)
254var ep0 = container.GetEndpoint("ep0"); 255var ep1 = container.GetEndpoint("ep1"); 256var ep2 = container.GetEndpoint("ep2");
WithEnvironmentTests.cs (4)
233var endpoint = container.GetEndpoint("primary"); 282var endpoint = container.GetEndpoint("primary"); 308var endpoint = container.GetEndpoint("primary"); 441var endpoint = container.GetEndpoint("primary");
WithUrlsTests.cs (2)
324var httpEndpoint = servicea.Resource.GetEndpoint("http"); 358var httpEndpoint = servicea.Resource.GetEndpoint("http");
Aspire.Hosting.Valkey (2)
ValkeyResource.cs (2)
14private EndpointReference? _primaryEndpoint; 34public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.Yarp (7)
ConfigurationBuilder\IYarpConfigurationBuilder.cs (3)
27public YarpCluster AddCluster(EndpointReference endpoint); 68public static YarpRoute AddRoute(this IYarpConfigurationBuilder builder, EndpointReference endpoint) 91public static YarpRoute AddRoute(this IYarpConfigurationBuilder builder, string path, EndpointReference endpoint)
ConfigurationBuilder\YarpCluster.cs (3)
26internal YarpCluster(EndpointReference endpoint) 74var httpsEndpoint = resource.GetEndpoint("https"); 75var httpEndpoint = resource.GetEndpoint("http");
ConfigurationBuilder\YarpConfigurationBuilder.cs (1)
27public YarpCluster AddCluster(EndpointReference endpoint)
Aspire.Hosting.Yarp.Tests (6)
YarpClusterTests.cs (4)
19var httpEndpoint = resource.GetEndpoint("testendpoint"); 20var httpsEndpoint = resource.GetEndpoint("anotherendpoint"); 37var httpEndpoint = resource.GetEndpoint("http"); 38var httpsEndpoint = resource.GetEndpoint("https");
YarpFunctionalTests.cs (2)
27private async Task VerifyYarpResource(Action<IResourceBuilder<YarpResource>, EndpointReference> configurator) 51var endpoint = yarp.Resource.GetEndpoint("http");