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)
173var url = new ResourceUrlAnnotation { Url = allocatedEndpoint.UriString, Endpoint = new EndpointReference(resourceWithEndpoints, endpoint) };
ResourceBuilderExtensions.cs (1)
577var endpointReference = new EndpointReference(resourceWithEndpoints, annotation);
Aspire.Hosting.Azure.Tests (1)
AzureBicepResourceTests.cs (1)
2074=> 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)
22PrimaryEndpoint = 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");
135 references to EndpointReference
Aspire.Hosting (38)
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 (20)
142public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, EndpointReference endpointReference) where T : IResourceWithEnvironment 324foreach (var endpoint in annotation.Resource.GetEndpoints()) 432public static IResourceBuilder<TDestination> WithReference<TDestination>(this IResourceBuilder<TDestination> builder, EndpointReference endpointReference) 577var endpointReference = new EndpointReference(resourceWithEndpoints, annotation); 675/// 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). 676/// The <see cref="EndpointReference"/> can be used to resolve the address of the endpoint in <see cref="WithEnvironment{T}(IResourceBuilder{T}, Action{EnvironmentCallbackContext})"/>. 681/// <returns>An <see cref="EndpointReference"/> that can be used to resolve the address of the endpoint after resource allocation has occurred.</returns> 682public static EndpointReference GetEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string name) where T : IResourceWithEndpoints 844var endpoint = url.ValueProviders.OfType<EndpointReference>().FirstOrDefault(); 864/// To add another URL for an endpoint, use <see cref="WithUrlForEndpoint{T}(IResourceBuilder{T}, string, Func{EndpointReference, ResourceUrlAnnotation})"/>. 937public static IResourceBuilder<T> WithUrlForEndpoint<T>(this IResourceBuilder<T> builder, string endpointName, Func<EndpointReference, ResourceUrlAnnotation> callback) 942var endpoint = builder.GetEndpoint(endpointName); 1258var endpoint = builder.Resource.GetEndpoint(endpointName); 1604Func<EndpointReference>? endpointSelector, 1611var endpoint = endpointSelector() 1704private static Func<EndpointReference> NamedEndpointSelector<TResource>(IResourceBuilder<TResource> builder, string[] endpointNames) 1710EndpointReference? matchingEndpoint = null; 1730private static Func<EndpointReference> DefaultEndpointSelector<TResource>(IResourceBuilder<TResource> builder) 1736EndpointReference? 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)
138/// The <see cref="EndpointReference"/> to use for the value of the <see cref="ProvisioningParameter"/>. 146/// This is useful when assigning a <see cref="BicepValue"/> to the value of an Aspire <see cref="EndpointReference"/>. 148public static ProvisioningParameter AsProvisioningParameter(this EndpointReference endpointReference, AzureResourceInfrastructure infrastructure, string parameterName) 172/// This is useful when assigning a <see cref="BicepValue"/> to the value of an Aspire <see cref="EndpointReference"/>.
AzureResourcePreparer.cs (1)
346if (value is string or EndpointReference or ParameterResource or EndpointReferenceExpression or HostUrl)
Aspire.Hosting.Azure.AppContainers (1)
ContainerAppContext.cs (1)
549if (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)
258var blobEndpoint = storage.GetEndpoint("blob"); 259var tableEndpoint = storage.GetEndpoint("table");
AzureEventHubsResource.cs (1)
38internal EndpointReference EmulatorEndpoint => new(this, "emulator");
Aspire.Hosting.Azure.Functions (2)
AzureFunctionsProjectResourceExtensions.cs (2)
102var endpoint = resource.GetEndpoint("http"); 188var targetEndpoint = builder.Resource.GetEndpoint(useHttps ? "https" : "http");
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (1)
381var 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)
13private static void AppendEndpointExpression(ReferenceExpressionBuilder builder, string key, EndpointReference endpoint) 18public static ReferenceExpression Create(EndpointReference? blobEndpoint = null, EndpointReference? queueEndpoint = null, EndpointReference? tableEndpoint = null)
AzureStorageResource.cs (3)
18private EndpointReference EmulatorBlobEndpoint => new(this, "blob"); 19private EndpointReference EmulatorQueueEndpoint => new(this, "queue"); 20private EndpointReference EmulatorTableEndpoint => new(this, "table");
Aspire.Hosting.Azure.Tests (13)
AzureBicepResourceTests.cs (1)
2073EndpointReference GetEndpointReference(string name, int port)
AzureContainerAppsTests.cs (6)
758var httpEp = project.GetEndpoint("http"); 759var httpsEp = project.GetEndpoint("https"); 760var internalEp = project.GetEndpoint("internal"); 1096var httpEp = project.GetEndpoint("http"); 1097var httpsEp = project.GetEndpoint("https"); 1098var internalEp = project.GetEndpoint("internal");
AzureCosmosDBExtensionsTests.cs (1)
83var endpoint = cosmos.GetEndpoint("data-explorer");
AzureProvisioningResourceExtensionsTests.cs (1)
21var endpointReference = apiProject.GetEndpoint("https");
src\Aspire.Hosting.Azure.Storage\AzureStorageEmulatorConnectionString.cs (4)
13private static void AppendEndpointExpression(ReferenceExpressionBuilder builder, string key, EndpointReference endpoint) 18public static ReferenceExpression Create(EndpointReference? blobEndpoint = null, EndpointReference? queueEndpoint = null, EndpointReference? tableEndpoint = null)
Aspire.Hosting.Docker (2)
DockerComposeEnvironmentContext.cs (1)
111.Where(kvp => kvp.Value is EndpointReference epRef && epRef.Scheme == "https" && kvp.Key.StartsWith("services__"))
DockerComposeServiceResourceExtensions.cs (1)
20if (value is EndpointReference ep)
Aspire.Hosting.Elasticsearch (4)
ElasticsearchResource.cs (4)
27private EndpointReference? _primaryEndpoint; 28private EndpointReference? _internalEndpoint; 33public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName); 38public EndpointReference InternalEndpoint => _internalEndpoint ??= new(this, InternalEndpointName);
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)
126var endpoint = singleInstance.PrimaryEndpoint; 248var endpoint = mySqlInstance.PrimaryEndpoint;
MySqlServerResource.cs (1)
29public 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)
86var endpoint = redis.GetEndpoint("tcp"); 613var 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)
629var http = resource.GetEndpoint("http"); 630var 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)
301var httpEndpoint = servicea.Resource.GetEndpoint("http"); 335var httpEndpoint = servicea.Resource.GetEndpoint("http");
Aspire.Hosting.Valkey (2)
ValkeyResource.cs (2)
14private EndpointReference? _primaryEndpoint; 34public EndpointReference PrimaryEndpoint => _primaryEndpoint ??= new(this, PrimaryEndpointName);