diff --git a/src/Aspire.Hosting/ResourceBuilderExtensions.cs b/src/Aspire.Hosting/ResourceBuilderExtensions.cs index 19ea1f7cbf8..3864ec18cda 100644 --- a/src/Aspire.Hosting/ResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting/ResourceBuilderExtensions.cs @@ -467,6 +467,28 @@ private static void ApplyEndpoints(this IResourceBuilder builder, IResourc /// Callback that modifies the endpoint. /// Create endpoint if it does not exist. /// The . + /// + /// + /// The method allows + /// developers to mutate any aspect of an endpoint annotation. Note that changing one value does not automatically change + /// other values to compatable/consistent values. For example setting the property + /// of the endpoint annotation in the callback will not automatically change the . + /// All values should be set in the callback if the defaults are not acceptable. + /// + /// + /// + /// Configure an endpoint to use UDP. + /// + /// var builder = DistributedApplication.Create(args); + /// var container = builder.AddContainer("mycontainer", "myimage") + /// .WithEndpoint("myendpoint", e => { + /// e.Port = 9998; + /// e.TargetPort = 9999; + /// e.Protocol = ProtocolType.Udp; + /// e.UriScheme = "udp"; + /// }); + /// + /// [System.Diagnostics.CodeAnalysis.SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "")] public static IResourceBuilder WithEndpoint(this IResourceBuilder builder, [EndpointName] string endpointName, Action callback, bool createIfNotExists = true) where T : IResourceWithEndpoints {