1 write to Name
Aspire.Hosting (1)
ApplicationModel\EndpointAnnotation.cs (1)
49Name = name;
112 references to Name
Aspire.Hosting (19)
ApplicationModel\EndpointReference.cs (2)
110_endpointAnnotation ??= Resource.Annotations.OfType<EndpointAnnotation>().SingleOrDefault(a => StringComparers.EndpointAnnotationName.Equals(a.Name, EndpointName)); 125EndpointName = endpoint.Name;
Dcp\DcpExecutor.cs (7)
843throw new InvalidOperationException($"Service '{svc.Metadata.Name}' needs to specify a port for endpoint '{sp.EndpointAnnotation.Name}' since it isn't using a proxy."); 903svc.Annotate(CustomResource.EndpointNameAnnotation, endpoint.Name); 1591throw new InvalidOperationException($"The endpoint '{ea.Name}' for container resource '{modelResourceName}' must specify the {nameof(EndpointAnnotation.TargetPort)} value"); 1598throw new InvalidOperationException($"Resource '{modelResourceName}' uses multiple replicas and a proxy-less endpoint '{ea.Name}'. These features do not work together."); 1603throw new InvalidOperationException($"The endpoint '{ea.Name}' for resource '{modelResourceName}' is not using a proxy, and it has a value of {nameof(EndpointAnnotation.Port)} property that is different from the value of {nameof(EndpointAnnotation.TargetPort)} property. For proxy-less endpoints they must match."); 1613$"The endpoint '{ea.Name}' for resource '{modelResourceName}' requested a proxy ({nameof(ea.IsProxied)} is true). Non-container resources cannot be proxied when both {nameof(ea.TargetPort)} and {nameof(ea.Port)} are specified with the same value."); 1619$"Resource '{modelResourceName}' can have multiple replicas, and it uses endpoint '{ea.Name}' that has {nameof(ea.TargetPort)} property set. Each replica must have a unique port; setting {nameof(ea.TargetPort)} is not allowed.");
Dcp\DcpNameGenerator.cs (1)
84: GetObjectNameForResource(resource, _options.Value, endpoint.Name);
Devcontainers\DevcontainerPortForwardingLifecycleHook.cs (1)
58$"{resource.Name}-{endpoint.Name}");
ProjectResourceBuilderExtensions.cs (3)
474var url = context.Urls.FirstOrDefault(u => string.Equals(u.Endpoint?.EndpointName, endpoint.Name, StringComparisons.EndpointAnnotationName)); 533projectResource.Annotations.OfType<EndpointAnnotation>().FirstOrDefault(sb => sb.UriScheme == scheme || string.Equals(sb.Name, scheme, StringComparisons.EndpointAnnotationName)); 843context.EnvironmentVariables[$"Kestrel__Endpoints__{e.EndpointAnnotation.Name}__Url"] = url;
Publishing\ManifestPublishingContext.cs (1)
411Writer.WriteStartObject(endpoint.Name);
ResourceBuilderExtensions.cs (4)
650.Where(ea => StringComparers.EndpointAnnotationName.Equals(ea.Name, endpointName)) 702if (builder.Resource.Annotations.OfType<EndpointAnnotation>().Any(sb => string.Equals(sb.Name, annotation.Name, StringComparisons.EndpointAnnotationName))) 704throw new DistributedApplicationException($"Endpoint with name '{annotation.Name}' already exists. Endpoint name may not have been explicitly specified and was derived automatically from scheme argument (e.g. 'http', 'https', or 'tcp'). Multiple calls to WithEndpoint (and related methods) may result in a conflict if name argument is not specified. Each endpoint must have a unique name. For more information on networking in .NET Aspire see: https://aka.ms/dotnet/aspire/networking");
Aspire.Hosting.Azure.AppContainers (7)
ContainerAppContext.cs (7)
234throw new NotSupportedException($"The endpoint(s) {string.Join(", ", unsupportedEndpoints.Select(e => $"'{e.Name}'"))} specify an unsupported scheme. The supported schemes are 'http', 'https', and 'tcp'."); 255endpointIndexMap[endpoint.Name] = endpointIndexMap.Count; 323Index = g.Min(e => endpointIndexMap[e.Name]) 385throw new NotSupportedException($"The endpoint '{e.Name}' is an http endpoint and must use port 80"); 390throw new NotSupportedException($"The endpoint '{e.Name}' is an https endpoint and must use port 443"); 396_endpointMapping[e.Name] = new(e.UriScheme, NormalizedContainerAppName, port, targetPort, true, httpIngress.External); 416_endpointMapping[e.Name] = new(e.UriScheme, NormalizedContainerAppName, e.Port ?? g.Port.Value, g.Port.Value, false, g.External);
Aspire.Hosting.Azure.AppService (3)
AzureAppServiceWebsiteContext.cs (3)
88throw new NotSupportedException($"The endpoint(s) {string.Join(", ", unsupportedEndpoints.Select(e => $"'{e.Name}'"))} on resource '{resource.Name}' specifies an unsupported scheme. Only http and https are supported in App Service."); 95throw new NotSupportedException($"The endpoint '{endpoint.Name}' on resource '{resource.Name}' is not external. App Service only supports external endpoints."); 99_endpointMapping[endpoint.Name] = new(
Aspire.Hosting.Azure.Tests (5)
AzureEventHubsExtensionsTests.cs (2)
246Assert.Equal("emulator", endpoints[0].Name); 249Assert.Equal("emulatorhealth", endpoints[1].Name);
AzurePostgresExtensionsTests.cs (1)
183Assert.Equal("tcp", endpoint.Name);
AzureRedisExtensionsTests.cs (1)
133Assert.Equal("tcp", endpoint.Name);
AzureSqlExtensionsTests.cs (1)
152Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Docker (2)
DockerComposeEnvironmentContext.cs (2)
74serviceResource.EndpointMappings.Add(endpoint.Name, 81endpoint.Name));
Aspire.Hosting.Garnet.Tests (2)
AddGarnetTests.cs (2)
30Assert.Equal("tcp", endpoint.Name); 58Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Kafka.Tests (4)
AddKafkaTests.cs (4)
30var primaryEndpoint = Assert.Single(endpoints, e => e.Name == "tcp"); 33Assert.Equal("tcp", primaryEndpoint.Name); 39var internalEndpoint = Assert.Single(endpoints, e => e.Name == "internal"); 42Assert.Equal("internal", internalEndpoint.Name);
Aspire.Hosting.Keycloak.Tests (4)
KeycloakResourceBuilderTests.cs (4)
30var endpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == defaultEndpointName); 33Assert.Equal(defaultEndpointName, endpoint.Name); 41var healthEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == managementEndpointName); 44Assert.Equal(managementEndpointName, healthEndpoint.Name);
Aspire.Hosting.Kubernetes (6)
KubernetesResource.cs (6)
174var port = endpoint.TargetPort ?? throw new InvalidOperationException($"Unable to resolve port {endpoint.TargetPort} for endpoint {endpoint.Name} on resource {resource.Name}"); 176EndpointMappings[endpoint.Name] = new(endpoint.UriScheme, resource.Name.ToServiceName(), portValue, endpoint.Name); 184var paramName = $"port_{endpoint.Name}".ToHelmValuesSectionName(); 192EndpointMappings[endpoint.Name] = new(endpoint.UriScheme, resource.Name.ToServiceName(), helmExpression, endpoint.Name, helmExpression);
Aspire.Hosting.Milvus.Tests (5)
AddMilvusTests.cs (5)
36.FirstOrDefault(e => e.Name == "grpc"); 40Assert.Equal("grpc", endpoint.Name); 66.FirstOrDefault(e => e.Name == "grpc"); 70Assert.Equal("grpc", endpoint.Name); 191var grpcEndpoint = milvusResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc");
Aspire.Hosting.MongoDB.Tests (2)
AddMongoDBTests.cs (2)
31Assert.Equal("tcp", endpoint.Name); 59Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
56Assert.Equal("tcp", endpoint.Name); 95Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
107Assert.Equal("tcp", endpoint.Name); 153Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
55Assert.Equal("tcp", endpoint.Name); 94Assert.Equal("tcp", endpoint.Name); 176Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.PostgreSQL.Tests (3)
AddPostgresTests.cs (3)
65Assert.Equal("tcp", endpoint.Name); 119Assert.Equal("tcp", endpoint.Name); 212Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Qdrant.Tests (8)
AddQdrantTests.cs (8)
56.FirstOrDefault(e => e.Name == "grpc"); 60Assert.Equal("grpc", endpoint.Name); 95.FirstOrDefault(e => e.Name == "http"); 100Assert.Equal("http", endpoint.Name); 128.FirstOrDefault(e => e.Name == "grpc"); 132Assert.Equal("grpc", endpoint.Name); 290var grpcEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "grpc"); 298var httpEndpoint = qdrantResource.Annotations.OfType<EndpointAnnotation>().Single(e => e.Name == "http");
Aspire.Hosting.RabbitMQ.Tests (4)
AddRabbitMQTests.cs (4)
55var primaryEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "tcp"); 58Assert.Equal("tcp", primaryEndpoint.Name); 66var mangementEndpoint = Assert.Single(containerResource.Annotations.OfType<EndpointAnnotation>(), e => e.Name == "management"); 69Assert.Equal("management", mangementEndpoint.Name);
Aspire.Hosting.Redis.Tests (2)
AddRedisTests.cs (2)
38Assert.Equal("tcp", endpoint.Name); 66Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Seq.Tests (2)
AddSeqTests.cs (2)
29Assert.Equal("http", endpoint.Name); 57Assert.Equal("http", endpoint.Name);
Aspire.Hosting.SqlServer.Tests (1)
AddSqlServerTests.cs (1)
51Assert.Equal("tcp", endpoint.Name);
Aspire.Hosting.Tests (23)
Dashboard\DashboardResourceTests.cs (3)
552if (endpoint.Name == DashboardLifecycleHook.OtlpGrpcEndpointName) 556else if (endpoint.Name == DashboardLifecycleHook.OtlpHttpEndpointName) 560else if (endpoint.Name == "http")
Dcp\DcpExecutorTests.cs (1)
781.WithEndpointsInEnvironment(e => e.Name != "dontinjectme")
KestrelConfigTests.cs (10)
28Assert.Equal("http", a.Name); 34Assert.Equal("ExplicitHttp", a.Name); 64Assert.Equal("http", a.Name); 70Assert.Equal("ExplicitHttp", a.Name); 97Assert.Equal("https", a.Name); 114Assert.Equal("FirstHttpEndpoint", a.Name); 122Assert.Equal("SecondHttpEndpoint", a.Name); 287.WithEndpointsInEnvironment(e => e.Name != "FirstHttpEndpoint") 288.WithEndpointsInEnvironment(e => e.Name != "ExplicitProxiedHttp"); 462endpoint.AllocatedEndpoint = new AllocatedEndpoint(endpoint, "localhost", endpoint.Port ?? 0, targetPortExpression: $"port_{endpoint.Name}");
ProjectResourceTests.cs (3)
256Assert.Equal("https", a.Name); 262Assert.Equal("http", a.Name); 339.WithEndpointsInEnvironment(filter: e => e.Name != "dontinjectme")
WithEndpointTests.cs (6)
29.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single(); 46.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single(); 81.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single(); 219Assert.Equal("mybinding", endpoints[0].Name); 533.WithEndpointsInEnvironment(e => e.Name != "dontinjectme"); 608.Where(e => string.Equals(e.Name, "mybinding", EndpointAnnotationName)).Single();
Aspire.Hosting.Valkey.Tests (2)
AddValkeyTests.cs (2)
30Assert.Equal("tcp", endpoint.Name); 58Assert.Equal("tcp", endpoint.Name);
TestProject.AppHost (1)
TestProgram.cs (1)
179["Name"] = endpoint.Name,