16 instantiations of EndpointReference
Aspire.Hosting (4)
ApplicationModel\ResourceExtensions.cs (2)
508return endpoints.Select(e => new EndpointReference(resource, e)); 523return new EndpointReference(resource, endpointName);
Orchestrator\ApplicationOrchestrator.cs (1)
194var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = new EndpointReference(resourceWithEndpoints, endpoint) };
ResourceBuilderExtensions.cs (1)
594var endpointReference = new EndpointReference(resourceWithEndpoints, annotation);
Aspire.Hosting.Azure.Tests (1)
AzureBicepResourceTests.cs (1)
1300=> new(storage.Resource, new EndpointAnnotation(ProtocolType.Tcp, name: name, targetPort: port));
Aspire.Hosting.Milvus (1)
MilvusServerResource.cs (1)
36public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.MySql (1)
MySqlServerResource.cs (1)
25PrimaryEndpoint = new(this, PrimaryEndpointName);
Aspire.Hosting.Oracle (1)
OracleDatabaseServerResource.cs (1)
22PrimaryEndpoint = new(this, PrimaryEndpointName);
Aspire.Hosting.PostgreSQL (1)
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.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");
133 references to EndpointReference
Aspire.Hosting (39)
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 (1)
9/// or <see cref="ResourceBuilderExtensions.WithHttpCommand{TResource}(IResourceBuilder{TResource}, string, string, Func{EndpointReference}?, string?, HttpCommandOptions?)"/>.
ApplicationModel\HttpCommandOptions.cs (1)
16public Func<EndpointReference>? EndpointSelector { get; set; }
ApplicationModel\ProjectResource.cs (1)
25internal bool ShouldInjectEndpointEnvironment(EndpointReference e)
ApplicationModel\ResourceExtensions.cs (4)
503/// <returns>An enumeration of <see cref="EndpointReference"/> based on the <see cref="EndpointAnnotation"/> annotations from the resources' <see cref="IResource.Annotations"/> collection.</returns> 504public static IEnumerable<EndpointReference> GetEndpoints(this IResourceWithEndpoints resource) 519/// <returns>An <see cref="EndpointReference"/> object representing the endpoint reference 521public 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) =>
ResourceBuilderExtensions.cs (21)
143public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, EndpointReference endpointReference) where T : IResourceWithEnvironment 341foreach (var endpoint in annotation.Resource.GetEndpoints()) 449public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, EndpointReference endpointReference) 594var endpointReference = new EndpointReference(resourceWithEndpoints, annotation); 692/// 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). 693/// The <see cref="EndpointReference"/> can be used to resolve the address of the endpoint in <see cref="WithEnvironment{T}(IResourceBuilder{T}, Action{EnvironmentCallbackContext})"/>. 698/// <returns>An <see cref="EndpointReference"/> that can be used to resolve the address of the endpoint after resource allocation has occurred.</returns> 699public static EndpointReference GetEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string name) where T : IResourceWithEndpoints 861var endpoint = url.ValueProviders.OfType<EndpointReference>().FirstOrDefault(); 881/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference, ResourceUrlAnnotation})"/>. 954public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference, ResourceUrlAnnotation> callback) 959var endpoint = builder.GetEndpoint(endpointName); 1297public static IResourceBuilder<T> WithHttpHealthCheck<T>(this IResourceBuilder<T> builder, Func<EndpointReference>? endpointSelector, string? path = null, int? statusCode = null) where T : IResourceWithEndpoints 1301var endpoint = endpointSelector() 1646Func<EndpointReference>? endpointSelector, 1653var endpoint = endpointSelector() 1751private static Func<EndpointReference> NamedEndpointSelector<TResource>(IResourceBuilder<TResource> builder, string[] endpointNames, string errorDisplayNoun) 1757EndpointReference? matchingEndpoint = null; 1777private static Func<EndpointReference> DefaultEndpointSelector<TResource>(IResourceBuilder<TResource> builder) 1783EndpointReference? matchingEndpoint = null;
Aspire.Hosting.Azure (6)
AzureBicepResourceExtensions.cs (1)
299public 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)
365if (value is string or EndpointReference or ParameterResource or EndpointReferenceExpression or HostUrl)
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppContext.cs (1)
504if (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)
262var blobEndpoint = storage.GetEndpoint("blob"); 263var tableEndpoint = storage.GetEndpoint("table");
AzureEventHubsResource.cs (1)
38internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.Functions (2)
AzureFunctionsProjectResourceExtensions.cs (2)
108var endpoint = resource.GetEndpoint("http"); 194var targetEndpoint = builder.Resource.GetEndpoint(useHttps ? "https" : "http");
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (1)
383var sqlEndpoint = sqlEdgeResource.Resource.GetEndpoint("tcp");
AzureServiceBusResource.cs (1)
28internal 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)
AzureBicepResourceTests.cs (1)
1299EndpointReference GetEndpointReference(string name, int port)
AzureContainerAppsTests.cs (6)
310var httpEp = project.GetEndpoint("http"); 311var httpsEp = project.GetEndpoint("https"); 312var internalEp = project.GetEndpoint("internal"); 388var httpEp = project.GetEndpoint("http"); 389var httpsEp = project.GetEndpoint("https"); 390var internalEp = project.GetEndpoint("internal");
AzureCosmosDBExtensionsTests.cs (1)
82var endpoint = cosmos.GetEndpoint("data-explorer");
AzureProvisioningResourceExtensionsTests.cs (1)
20var endpointReference = apiProject.GetEndpoint("https");
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 (2)
DockerComposeEnvironmentContext.cs (1)
105.Where(kvp => kvp.Value is EndpointReference epRef && epRef.Scheme == "https" && kvp.Key.StartsWith("services__"))
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 (5)
KafkaBuilderExtensions.cs (1)
137static void ConfigureKafkaUIContainer(EnvironmentCallbackContext context, EndpointReference endpoint, int index)
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)
219var endpoint = singleInstance.PrimaryEndpoint; 341var 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)
513var 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)
24private EndpointReference? _primaryEndpoint; 29public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);
Aspire.Hosting.Redis.Tests (2)
RedisFunctionalTests.cs (2)
85var endpoint = redis.GetEndpoint("tcp"); 612var 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 (13)
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 (3)
233var endpoint = container.GetEndpoint("primary"); 282var endpoint = container.GetEndpoint("primary"); 308var endpoint = container.GetEndpoint("primary");
WithUrlsTests.cs (2)
330var httpEndpoint = servicea.Resource.GetEndpoint("http"); 364var httpEndpoint = servicea.Resource.GetEndpoint("http");
Aspire.Hosting.Valkey (2)
ValkeyResource.cs (2)
14private EndpointReference? _primaryEndpoint; 34public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);