diff --git a/src/Aspire.Hosting.Azure.AppConfiguration/AzureAppConfigurationExtensions.cs b/src/Aspire.Hosting.Azure.AppConfiguration/AzureAppConfigurationExtensions.cs index 4ece173c837..8694183e7d5 100644 --- a/src/Aspire.Hosting.Azure.AppConfiguration/AzureAppConfigurationExtensions.cs +++ b/src/Aspire.Hosting.Azure.AppConfiguration/AzureAppConfigurationExtensions.cs @@ -29,7 +29,7 @@ public static class AzureAppConfigurationExtensions /// /// These can be replaced by calling . /// - [AspireExport("addAzureAppConfiguration", Description = "Adds an Azure App Configuration resource")] + [AspireExport(Description = "Adds an Azure App Configuration resource")] public static IResourceBuilder AddAzureAppConfiguration(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -93,7 +93,7 @@ public static IResourceBuilder AddAzureAppConfigu /// The Azure App Configuration resource builder. /// Callback that exposes underlying container used for emulation to allow for customization. /// A reference to the . - [AspireExport("runAsEmulator", Description = "Configures Azure App Configuration to run with the local emulator", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures Azure App Configuration to run with the local emulator", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsEmulator(this IResourceBuilder builder, Action>? configureEmulator = null) { if (builder.ApplicationBuilder.ExecutionContext.IsPublishMode) @@ -127,7 +127,7 @@ public static IResourceBuilder RunAsEmulator(this /// The builder for the . /// Relative path to the AppHost where emulator storage is persisted between runs. Defaults to the path '.aace' /// A builder for the . - [AspireExport("withDataBindMount", Description = "Adds a data bind mount for the App Configuration emulator")] + [AspireExport(Description = "Adds a data bind mount for the App Configuration emulator")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string? path = null) { ArgumentNullException.ThrowIfNull(builder); @@ -141,7 +141,7 @@ public static IResourceBuilder WithDataBi /// The builder for the . /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A builder for the . - [AspireExport("withDataVolume", Description = "Adds a data volume for the App Configuration emulator")] + [AspireExport(Description = "Adds a data volume for the App Configuration emulator")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null) { ArgumentNullException.ThrowIfNull(builder); @@ -155,7 +155,7 @@ public static IResourceBuilder WithDataVo /// Builder for the Azure App Configuration emulator container /// The port to bind on the host. If is used, a random port will be assigned. /// A reference to the . - [AspireExport("withHostPort", Description = "Sets the host port for the App Configuration emulator")] + [AspireExport(Description = "Sets the host port for the App Configuration emulator")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppExtensions.cs b/src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppExtensions.cs index 11c4d92ed5b..74afeae39c8 100644 --- a/src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppExtensions.cs +++ b/src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppExtensions.cs @@ -56,7 +56,7 @@ internal static IDistributedApplicationBuilder AddAzureContainerAppsInfrastructu /// The distributed application builder. /// The name of the resource. /// - [AspireExport("addAzureContainerAppEnvironment", Description = "Adds an Azure Container App Environment resource")] + [AspireExport(Description = "Adds an Azure Container App Environment resource")] public static IResourceBuilder AddAzureContainerAppEnvironment(this IDistributedApplicationBuilder builder, string name) { builder.AddAzureContainerAppsInfrastructureCore(); @@ -410,7 +410,7 @@ public static IResourceBuilder AddAzureCon /// This method allows for reusing the previously deployed resources if the application was deployed using /// azd without calling /// - [AspireExport("withAzdResourceNaming", Description = "Configures resources to use azd naming conventions")] + [AspireExport(Description = "Configures resources to use azd naming conventions")] public static IResourceBuilder WithAzdResourceNaming(this IResourceBuilder builder) { builder.Resource.UseAzdNamingConvention = true; @@ -440,7 +440,7 @@ public static IResourceBuilder WithAzdReso /// Use to change those names as well. /// /// - [AspireExport("withCompactResourceNaming", Description = "Configures resources to use compact naming for length-constrained Azure resources")] + [AspireExport(Description = "Configures resources to use compact naming for length-constrained Azure resources")] [Experimental("ASPIREACANAMING001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder WithCompactResourceNaming(this IResourceBuilder builder) { @@ -454,7 +454,7 @@ public static IResourceBuilder WithCompact /// The AzureContainerAppEnvironmentResource to configure. /// Whether to include the Aspire dashboard. Default is true. /// - [AspireExport("withDashboard", Description = "Configures whether the Aspire dashboard is included in the container app environment")] + [AspireExport(Description = "Configures whether the Aspire dashboard is included in the container app environment")] public static IResourceBuilder WithDashboard(this IResourceBuilder builder, bool enable = true) { builder.Resource.EnableDashboard = enable; @@ -473,7 +473,7 @@ public static IResourceBuilder WithDashboa /// Note that explicit ports specified for development (e.g., port 8080) are still normalized /// to standard ports (80/443) as required by Azure Container Apps. /// - [AspireExport("withHttpsUpgrade", Description = "Configures whether HTTP endpoints are upgraded to HTTPS")] + [AspireExport(Description = "Configures whether HTTP endpoints are upgraded to HTTPS")] public static IResourceBuilder WithHttpsUpgrade(this IResourceBuilder builder, bool upgrade = true) { builder.Resource.PreserveHttpEndpoints = !upgrade; @@ -487,7 +487,7 @@ public static IResourceBuilder WithHttpsUp /// The resource builder for the to use. /// /// Thrown when or is null. - [AspireExport("withAzureLogAnalyticsWorkspace", Description = "Configures the container app environment to use a specific Log Analytics Workspace")] + [AspireExport(Description = "Configures the container app environment to use a specific Log Analytics Workspace")] public static IResourceBuilder WithAzureLogAnalyticsWorkspace(this IResourceBuilder builder, IResourceBuilder workspaceBuilder) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs b/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs index 6834d8a1ec6..df7e4591b07 100644 --- a/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs +++ b/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs @@ -189,7 +189,7 @@ public static IResourceBuilder PublishAsAzureContainerAppJob(this IResourc /// /// /// - [AspireExport("publishAsAzureContainerAppJob", Description = "Configures the compute resource as a manually triggered Azure Container App Job")] + [AspireExport(Description = "Configures the compute resource as a manually triggered Azure Container App Job")] [Experimental("ASPIREAZURE002", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder PublishAsAzureContainerAppJob(this IResourceBuilder resource) where T : IComputeResource @@ -250,7 +250,7 @@ public static IResourceBuilder PublishAsScheduledAzureContainerAppJob(this /// /// This method is a convenience wrapper that configures the job with a schedule trigger using the specified cron expression. /// - [AspireExport("publishAsScheduledAzureContainerAppJob", Description = "Configures the compute resource as a scheduled Azure Container App Job")] + [AspireExport(Description = "Configures the compute resource as a scheduled Azure Container App Job")] [Experimental("ASPIREAZURE002", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] internal static IResourceBuilder PublishAsScheduledAzureContainerAppJob(this IResourceBuilder resource, string cronExpression) where T : IComputeResource diff --git a/src/Aspire.Hosting.Azure.AppService/AzureAppServiceComputeResourceExtensions.cs b/src/Aspire.Hosting.Azure.AppService/AzureAppServiceComputeResourceExtensions.cs index 94f1690367a..416fd7b0acb 100644 --- a/src/Aspire.Hosting.Azure.AppService/AzureAppServiceComputeResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure.AppService/AzureAppServiceComputeResourceExtensions.cs @@ -30,7 +30,7 @@ public static class AzureAppServiceComputeResourceExtensions /// /// /// - [AspireExport("publishAsAzureAppServiceWebsite", Description = "Publishes the compute resource as an Azure App Service website or deployment slot")] + [AspireExport(Description = "Publishes the compute resource as an Azure App Service website or deployment slot")] public static IResourceBuilder PublishAsAzureAppServiceWebsite(this IResourceBuilder builder, Action? configure = null, Action? configureSlot = null) @@ -75,7 +75,7 @@ public static IResourceBuilder PublishAsAzureAppServiceWebsite(this IResou /// The compute resource builder. /// The updated compute resource builder. /// Thrown when the resource is not configured for Azure App Service publishing. - [AspireExport("skipEnvironmentVariableNameChecks", Description = "Skips Azure App Service environment variable name validation for the compute resource")] + [AspireExport(Description = "Skips Azure App Service environment variable name validation for the compute resource")] public static IResourceBuilder SkipEnvironmentVariableNameChecks(this IResourceBuilder builder) where T : IComputeResource { diff --git a/src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs b/src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs index a6905617534..c4299470cfb 100644 --- a/src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs +++ b/src/Aspire.Hosting.Azure.AppService/AzureAppServiceEnvironmentExtensions.cs @@ -40,7 +40,7 @@ internal static IDistributedApplicationBuilder AddAzureAppServiceInfrastructureC /// The distributed application builder. /// The name of the resource. /// - [AspireExport("addAzureAppServiceEnvironment", Description = "Adds an Azure App Service environment resource")] + [AspireExport(Description = "Adds an Azure App Service environment resource")] public static IResourceBuilder AddAzureAppServiceEnvironment(this IDistributedApplicationBuilder builder, string name) { builder.AddAzureAppServiceInfrastructureCore(); @@ -232,7 +232,7 @@ public static IResourceBuilder AddAzureAppSe /// The to configure. /// Whether to include the Aspire dashboard. Default is true. /// A reference to the for chaining additional configuration. - [AspireExport("withDashboard", Description = "Configures whether the Aspire dashboard is included in the Azure App Service environment")] + [AspireExport(Description = "Configures whether the Aspire dashboard is included in the Azure App Service environment")] public static IResourceBuilder WithDashboard(this IResourceBuilder builder, bool enable = true) { builder.Resource.EnableDashboard = enable; @@ -244,7 +244,7 @@ public static IResourceBuilder WithDashboard /// /// The AzureAppServiceEnvironmentResource to configure. /// - [AspireExport("withAzureApplicationInsights", Description = "Enables Azure Application Insights for the Azure App Service environment")] + [AspireExport(Description = "Enables Azure Application Insights for the Azure App Service environment")] public static IResourceBuilder WithAzureApplicationInsights(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder); @@ -316,7 +316,7 @@ public static IResourceBuilder WithDeploymen /// The AzureAppServiceEnvironmentResource to configure. /// The deployment slot for all App Services in the App Service Environment. /// - [AspireExport("withDeploymentSlot", Description = "Configures the deployment slot for all Azure App Services in the environment")] + [AspireExport(Description = "Configures the deployment slot for all Azure App Services in the environment")] public static IResourceBuilder WithDeploymentSlot(this IResourceBuilder builder, string deploymentSlot) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.ApplicationInsights/AzureApplicationInsightsExtensions.cs b/src/Aspire.Hosting.Azure.ApplicationInsights/AzureApplicationInsightsExtensions.cs index b190b6375da..b2d9ee7b066 100644 --- a/src/Aspire.Hosting.Azure.ApplicationInsights/AzureApplicationInsightsExtensions.cs +++ b/src/Aspire.Hosting.Azure.ApplicationInsights/AzureApplicationInsightsExtensions.cs @@ -20,7 +20,7 @@ public static class AzureApplicationInsightsExtensions /// The . /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// A reference to the . - [AspireExport("addAzureApplicationInsights", Description = "Adds an Azure Application Insights resource")] + [AspireExport(Description = "Adds an Azure Application Insights resource")] public static IResourceBuilder AddAzureApplicationInsights(this IDistributedApplicationBuilder builder, [ResourceName] string name) => AddAzureApplicationInsights(builder, name, logAnalyticsWorkspace: null); @@ -145,7 +145,7 @@ public static IResourceBuilder WithLogAnalytic /// The resource builder for . /// The resource builder for the . /// The for chaining. - [AspireExport("withLogAnalyticsWorkspace", Description = "Configures the Application Insights resource to use a Log Analytics Workspace")] + [AspireExport(Description = "Configures the Application Insights resource to use a Log Analytics Workspace")] public static IResourceBuilder WithLogAnalyticsWorkspace( this IResourceBuilder builder, IResourceBuilder logAnalyticsWorkspace) diff --git a/src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIExtensions.cs b/src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIExtensions.cs index 6040ac2ea4d..da27cf443dd 100644 --- a/src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIExtensions.cs +++ b/src/Aspire.Hosting.Azure.CognitiveServices/AzureOpenAIExtensions.cs @@ -28,7 +28,7 @@ public static class AzureOpenAIExtensions /// /// These can be replaced by calling . /// - [AspireExport("addAzureOpenAI", Description = "Adds an Azure OpenAI resource")] + [AspireExport(Description = "Adds an Azure OpenAI resource")] public static IResourceBuilder AddAzureOpenAI(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -171,7 +171,7 @@ public static IResourceBuilder AddDeployment(this IResource /// The name of the model to deploy. /// The version of the model to deploy. /// A reference to the . - [AspireExport("addDeployment", Description = "Adds an Azure OpenAI deployment resource")] + [AspireExport(Description = "Adds an Azure OpenAI deployment resource")] public static IResourceBuilder AddDeployment(this IResourceBuilder builder, [ResourceName] string name, string modelName, string modelVersion) { ArgumentNullException.ThrowIfNull(builder); @@ -191,7 +191,7 @@ public static IResourceBuilder AddDeployment(this /// The Azure OpenAI Deployment resource builder. /// A method that can be used for customizing the . /// A reference to the . - [AspireExport("withProperties", Description = "Configures properties of an Azure OpenAI deployment", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures properties of an Azure OpenAI deployment", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithProperties(this IResourceBuilder builder, Action configure) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.ContainerRegistry/AzureContainerRegistryExtensions.cs b/src/Aspire.Hosting.Azure.ContainerRegistry/AzureContainerRegistryExtensions.cs index a81c7cb7fb1..ed0c1973625 100644 --- a/src/Aspire.Hosting.Azure.ContainerRegistry/AzureContainerRegistryExtensions.cs +++ b/src/Aspire.Hosting.Azure.ContainerRegistry/AzureContainerRegistryExtensions.cs @@ -27,7 +27,7 @@ public static class AzureContainerRegistryExtensions /// A reference to the builder. /// Thrown when is null. /// Thrown when is null or empty. - [AspireExport("addAzureContainerRegistry", Description = "Adds an Azure Container Registry resource to the distributed application model.")] + [AspireExport(Description = "Adds an Azure Container Registry resource to the distributed application model.")] public static IResourceBuilder AddAzureContainerRegistry(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -123,7 +123,7 @@ public static IResourceBuilder WithAzureContainerRegistry(this IResourceBu /// Thrown when is . /// Thrown when the resource does not have an associated Azure Container Registry, /// or when the associated container registry is not an . - [AspireExport("getAzureContainerRegistry", Description = "Gets the Azure Container Registry associated with a compute environment resource.")] + [AspireExport(Description = "Gets the Azure Container Registry associated with a compute environment resource.")] public static IResourceBuilder GetAzureContainerRegistry(this IResourceBuilder builder) where T : IResource, IAzureComputeEnvironmentResource { @@ -163,7 +163,7 @@ public static IResourceBuilder GetAzureContainer /// .WithPurgeTask("0 1 * * *", ago: TimeSpan.FromDays(7), keep: 5); /// /// - [AspireExport("withPurgeTask", Description = "Configures a purge task for the Azure Container Registry resource.")] + [AspireExport(Description = "Configures a purge task for the Azure Container Registry resource.")] public static IResourceBuilder WithPurgeTask( this IResourceBuilder builder, string schedule, diff --git a/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs index 69532183455..7726c22471d 100644 --- a/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs +++ b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs @@ -32,7 +32,7 @@ public static class AzureCosmosExtensions /// The . /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// A reference to the . - [AspireExport("addAzureCosmosDB", Description = "Adds an Azure Cosmos DB resource")] + [AspireExport(Description = "Adds an Azure Cosmos DB resource")] public static IResourceBuilder AddAzureCosmosDB(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -57,7 +57,7 @@ public static IResourceBuilder AddAzureCosmosDB(this IDis /// For more information, see . /// This version of the package defaults to the tag of the / container image. /// - [AspireExport("runAsEmulator", Description = "Configures the Azure Cosmos DB resource to run using the local emulator", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Azure Cosmos DB resource to run using the local emulator", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsEmulator(this IResourceBuilder builder, Action>? configureContainer = null) => RunAsEmulator(builder, configureContainer, useVNextPreview: false); @@ -71,7 +71,7 @@ public static IResourceBuilder RunAsEmulator(this IResour /// /// This version of the package defaults to the tag of the / container image. /// - [AspireExport("runAsPreviewEmulator", Description = "Configures the Azure Cosmos DB resource to run using the preview emulator", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Azure Cosmos DB resource to run using the preview emulator", RunSyncOnBackgroundThread = true)] [Experimental("ASPIRECOSMOSDB001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder RunAsPreviewEmulator(this IResourceBuilder builder, Action>? configureContainer = null) => RunAsEmulator(builder, configureContainer, useVNextPreview: true); @@ -234,7 +234,7 @@ static CosmosClient CreateCosmosClient(string connectionString) /// The builder for the . /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A builder for the . - [AspireExport("withDataVolume", Description = "Adds a named volume for the data folder to an Azure Cosmos DB emulator resource")] + [AspireExport(Description = "Adds a named volume for the data folder to an Azure Cosmos DB emulator resource")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null) { ArgumentNullException.ThrowIfNull(builder); @@ -251,7 +251,7 @@ public static IResourceBuilder WithDataVolume(thi /// Builder for the Cosmos emulator container /// Host port to bind to the emulator gateway port. /// Cosmos emulator resource builder. - [AspireExport("withGatewayPort", Description = "Sets the host port for the Cosmos DB emulator gateway endpoint")] + [AspireExport(Description = "Sets the host port for the Cosmos DB emulator gateway endpoint")] public static IResourceBuilder WithGatewayPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); @@ -271,7 +271,7 @@ public static IResourceBuilder WithGatewayPort(th /// Not calling this method will result in the default of 10 partitions. The actual started partitions is always one more than specified. /// See this documentation about setting the partition count. /// - [AspireExport("withPartitionCount", Description = "Sets the partition count for the Azure Cosmos DB emulator")] + [AspireExport(Description = "Sets the partition count for the Azure Cosmos DB emulator")] public static IResourceBuilder WithPartitionCount(this IResourceBuilder builder, int count) { ArgumentNullException.ThrowIfNull(builder); @@ -315,7 +315,7 @@ public static IResourceBuilder AddDatabase(this IResource /// The name of the database resource. /// The name of the database. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addCosmosDatabase", Description = "Adds an Azure Cosmos DB database resource")] + [AspireExport(Description = "Adds an Azure Cosmos DB database resource")] public static IResourceBuilder AddCosmosDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -338,7 +338,7 @@ public static IResourceBuilder AddCosmosDatabase( /// Partition key path for the container. /// The name of the container. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addContainer", Description = "Adds an Azure Cosmos DB container resource")] + [AspireExport(Description = "Adds an Azure Cosmos DB container resource")] public static IResourceBuilder AddContainer(this IResourceBuilder builder, [ResourceName] string name, string partitionKeyPath, string? containerName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -394,7 +394,7 @@ public static IResourceBuilder AddContainer(this /// /// The builder for the Azure Cosmos DB resource. /// A reference to the . - [AspireExport("withDefaultAzureSku", Description = "Configures Azure Cosmos DB to use the default Azure SKU")] + [AspireExport(Description = "Configures Azure Cosmos DB to use the default Azure SKU")] public static IResourceBuilder WithDefaultAzureSku(this IResourceBuilder builder) { builder.Resource.UseDefaultAzureSku = true; @@ -410,7 +410,7 @@ public static IResourceBuilder WithDefaultAzureSku(this I /// /// The Data Explorer is only available with . /// - [AspireExport("withDataExplorer", Description = "Exposes the Data Explorer endpoint for the preview emulator")] + [AspireExport(Description = "Exposes the Data Explorer endpoint for the preview emulator")] [Experimental("ASPIRECOSMOSDB001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder WithDataExplorer(this IResourceBuilder builder, int? port = null) { @@ -473,7 +473,7 @@ public static IResourceBuilder WithDataExplorer(t /// /// /// - [AspireExport("withAccessKeyAuthentication", Description = "Configures Azure Cosmos DB to use access key authentication")] + [AspireExport(Description = "Configures Azure Cosmos DB to use access key authentication")] public static IResourceBuilder WithAccessKeyAuthentication(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsExtensions.cs b/src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsExtensions.cs index 3513f5d7c04..124c88b511c 100644 --- a/src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsExtensions.cs +++ b/src/Aspire.Hosting.Azure.EventHubs/AzureEventHubsExtensions.cs @@ -37,7 +37,7 @@ public static class AzureEventHubsExtensions /// /// These can be replaced by calling . /// - [AspireExport("addAzureEventHubs", Description = "Adds an Azure Event Hubs namespace resource")] + [AspireExport(Description = "Adds an Azure Event Hubs namespace resource")] public static IResourceBuilder AddAzureEventHubs( this IDistributedApplicationBuilder builder, [ResourceName] string name) { @@ -152,7 +152,7 @@ public static IResourceBuilder AddEventHub(this IResourc /// The name of the Event Hub resource. /// The name of the Event Hub. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addHub", Description = "Adds an Azure Event Hub resource")] + [AspireExport(Description = "Adds an Azure Event Hub resource")] public static IResourceBuilder AddHub(this IResourceBuilder builder, [ResourceName] string name, string? hubName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -173,7 +173,7 @@ public static IResourceBuilder AddHub(this IResourceBuild /// The Azure Event Hub resource builder. /// A method that can be used for customizing the . /// A reference to the . - [AspireExport("withProperties", Description = "Configures properties of an Azure Event Hub", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures properties of an Azure Event Hub", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithProperties(this IResourceBuilder builder, Action configure) { ArgumentNullException.ThrowIfNull(builder); @@ -191,7 +191,7 @@ public static IResourceBuilder WithProperties(this IResou /// The name of the Event Hub Consumer Group resource. /// The name of the Consumer Group. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addConsumerGroup", Description = "Adds an Azure Event Hub consumer group resource")] + [AspireExport(Description = "Adds an Azure Event Hub consumer group resource")] public static IResourceBuilder AddConsumerGroup( this IResourceBuilder builder, [ResourceName] string name, @@ -237,7 +237,7 @@ public static IResourceBuilder AddConsumerGr /// builder.Build().Run(); /// /// - [AspireExport("runAsEmulator", Description = "Configures the Azure Event Hubs resource to run with the local emulator", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Azure Event Hubs resource to run with the local emulator", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsEmulator(this IResourceBuilder builder, Action>? configureContainer = null) { ArgumentNullException.ThrowIfNull(builder); @@ -405,7 +405,7 @@ public static IResourceBuilder WithGatewayPort(t /// Builder for the Azure Event Hubs emulator container /// The port to bind on the host. If is used, a random port will be assigned. /// Azure Event Hubs emulator resource builder. - [AspireExport("withHostPort", Description = "Sets the host port for the Event Hubs emulator endpoint")] + [AspireExport(Description = "Sets the host port for the Event Hubs emulator endpoint")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); @@ -422,7 +422,7 @@ public static IResourceBuilder WithHostPort(this /// The builder for the . /// Path to the file on the AppHost where the emulator configuration is located. /// A reference to the . - [AspireExport("withConfigurationFile", Description = "Sets the emulator configuration file path")] + [AspireExport(Description = "Sets the emulator configuration file path")] public static IResourceBuilder WithConfigurationFile(this IResourceBuilder builder, string path) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.Functions/AzureFunctionsProjectResourceExtensions.cs b/src/Aspire.Hosting.Azure.Functions/AzureFunctionsProjectResourceExtensions.cs index 33cbb3d1abe..02b4a6c47f0 100644 --- a/src/Aspire.Hosting.Azure.Functions/AzureFunctionsProjectResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure.Functions/AzureFunctionsProjectResourceExtensions.cs @@ -116,7 +116,7 @@ public static IResourceBuilder AddAzureFunctionsP /// /// /// - [AspireExport("addAzureFunctionsProject", Description = "Adds an Azure Functions project to the distributed application")] + [AspireExport(Description = "Adds an Azure Functions project to the distributed application")] public static IResourceBuilder AddAzureFunctionsProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath) { ArgumentNullException.ThrowIfNull(builder); @@ -316,7 +316,7 @@ private static IResourceBuilder WithFunctionsHttp /// The resource builder for the Azure Functions project resource. /// The resource builder for the Azure Storage resource to be used as host storage. /// The resource builder for the Azure Functions project resource, configured with the specified host storage. - [AspireExport("withHostStorage", Description = "Configures the Azure Functions project to use specified Azure Storage as host storage")] + [AspireExport(Description = "Configures the Azure Functions project to use specified Azure Storage as host storage")] public static IResourceBuilder WithHostStorage(this IResourceBuilder builder, IResourceBuilder storage) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs b/src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs index b16df76e6a0..3f416538c3e 100644 --- a/src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs @@ -25,7 +25,7 @@ public static class DurableTaskResourceExtensions /// var scheduler = builder.AddDurableTaskScheduler("scheduler"); /// /// - [AspireExport("addDurableTaskScheduler", Description = "Adds a Durable Task scheduler resource to the distributed application.")] + [AspireExport(Description = "Adds a Durable Task scheduler resource to the distributed application.")] public static IResourceBuilder AddDurableTaskScheduler(this IDistributedApplicationBuilder builder, [ResourceName] string name) { var scheduler = new DurableTaskSchedulerResource(name); @@ -120,7 +120,7 @@ internal static IResourceBuilder RunAsExistingCore /// .RunAsEmulator(); /// /// - [AspireExport("runAsEmulator", Description = "Configures the Durable Task scheduler to run using the local emulator.", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Durable Task scheduler to run using the local emulator.", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsEmulator(this IResourceBuilder builder, Action>? configureContainer = null) { ArgumentNullException.ThrowIfNull(builder); @@ -199,7 +199,7 @@ public static IResourceBuilder RunAsEmulator(this /// .WithTaskHubName("MyTaskHub"); /// /// - [AspireExport("addTaskHub", Description = "Adds a Durable Task hub resource associated with the scheduler.")] + [AspireExport(Description = "Adds a Durable Task hub resource associated with the scheduler.")] public static IResourceBuilder AddTaskHub(this IResourceBuilder builder, [ResourceName] string name) { var hub = new DurableTaskHubResource(name, builder.Resource); diff --git a/src/Aspire.Hosting.Azure.KeyVault/AzureKeyVaultResourceExtensions.cs b/src/Aspire.Hosting.Azure.KeyVault/AzureKeyVaultResourceExtensions.cs index c2f6a9ee5d4..410c13c9f85 100644 --- a/src/Aspire.Hosting.Azure.KeyVault/AzureKeyVaultResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure.KeyVault/AzureKeyVaultResourceExtensions.cs @@ -58,7 +58,7 @@ public static partial class AzureKeyVaultResourceExtensions /// /// /// - [AspireExport("addAzureKeyVault", Description = "Adds an Azure Key Vault resource")] + [AspireExport(Description = "Adds an Azure Key Vault resource")] public static IResourceBuilder AddAzureKeyVault(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -229,7 +229,7 @@ internal static IResourceBuilder WithRoleAssignments( /// The Azure Key Vault resource builder. /// The name of the secret. /// A reference to the secret. - [AspireExport("getSecret", Description = "Gets a secret reference from the Azure Key Vault")] + [AspireExport(Description = "Gets a secret reference from the Azure Key Vault")] public static IAzureKeyVaultSecretReference GetSecret(this IResourceBuilder builder, string secretName) { ArgumentNullException.ThrowIfNull(builder); @@ -244,7 +244,7 @@ public static IAzureKeyVaultSecretReference GetSecret(this IResourceBuilderThe name of the secret. Must follow Azure Key Vault naming rules. /// The parameter resource containing the secret value. /// A reference to the . - [AspireExport("addSecret", Description = "Adds a secret to the Azure Key Vault from a parameter resource")] + [AspireExport(Description = "Adds a secret to the Azure Key Vault from a parameter resource")] public static IResourceBuilder AddSecret(this IResourceBuilder builder, string name, IResourceBuilder parameterResource) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.Kusto/AzureKustoBuilderExtensions.cs b/src/Aspire.Hosting.Azure.Kusto/AzureKustoBuilderExtensions.cs index ef2e8651c05..d8e227c7ffb 100644 --- a/src/Aspire.Hosting.Azure.Kusto/AzureKustoBuilderExtensions.cs +++ b/src/Aspire.Hosting.Azure.Kusto/AzureKustoBuilderExtensions.cs @@ -41,7 +41,7 @@ public static class AzureKustoBuilderExtensions /// - /// /// - [AspireExport("addAzureKustoCluster", Description = "Adds an Azure Data Explorer (Kusto) cluster resource")] + [AspireExport(Description = "Adds an Azure Data Explorer (Kusto) cluster resource")] public static IResourceBuilder AddAzureKustoCluster(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -103,7 +103,7 @@ public static IResourceBuilder AddAzureKustoCluster(t /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// The name of the database. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addReadWriteDatabase", Description = "Adds a Kusto read-write database resource")] + [AspireExport(Description = "Adds a Kusto read-write database resource")] public static IResourceBuilder AddReadWriteDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -149,7 +149,7 @@ public static IResourceBuilder AddReadWrite /// Optional action to configure the Kusto emulator container. /// /// The resource builder. - [AspireExport("runAsEmulator", Description = "Configures the Kusto cluster to run using the local emulator", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Kusto cluster to run using the local emulator", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsEmulator( this IResourceBuilder builder, Action>? configureContainer = null) @@ -194,7 +194,7 @@ public static IResourceBuilder RunAsEmulator( /// The resource builder to configure. /// KQL script to create databases, tables, or data. /// The resource builder. - [AspireExport("withCreationScript", Description = "Defines the KQL script used to create the database")] + [AspireExport(Description = "Defines the KQL script used to create the database")] public static IResourceBuilder WithCreationScript(this IResourceBuilder builder, string script) { ArgumentNullException.ThrowIfNull(builder); @@ -212,7 +212,7 @@ public static IResourceBuilder WithCreation /// Kusto emulator resource builder. /// Host port to use. /// An for the . - [AspireExport("withHostPort", Description = "Sets the host port for the Kusto emulator endpoint")] + [AspireExport(Description = "Sets the host port for the Kusto emulator endpoint")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int port) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.Kusto/AzureKustoReadWriteDatabaseResourceExtensions.cs b/src/Aspire.Hosting.Azure.Kusto/AzureKustoReadWriteDatabaseResourceExtensions.cs index d616a006033..1fb80351f97 100644 --- a/src/Aspire.Hosting.Azure.Kusto/AzureKustoReadWriteDatabaseResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure.Kusto/AzureKustoReadWriteDatabaseResourceExtensions.cs @@ -16,7 +16,7 @@ internal static class AzureKustoReadWriteDatabaseResourceExtensions /// DATABASE_NAME is the database name and PERSISTENCE_PATH is . /// /// - [AspireExport("getDatabaseCreationScript", Description = "Gets the KQL script used to create the database.")] + [AspireExport(Description = "Gets the KQL script used to create the database.")] public static string GetDatabaseCreationScript(this AzureKustoReadWriteDatabaseResource databaseResource) { var scriptAnnotation = databaseResource.Annotations.OfType().LastOrDefault(); diff --git a/src/Aspire.Hosting.Azure.Network/AzureNatGatewayExtensions.cs b/src/Aspire.Hosting.Azure.Network/AzureNatGatewayExtensions.cs index a9c07e75239..c1149e6e84e 100644 --- a/src/Aspire.Hosting.Azure.Network/AzureNatGatewayExtensions.cs +++ b/src/Aspire.Hosting.Azure.Network/AzureNatGatewayExtensions.cs @@ -35,7 +35,7 @@ public static class AzureNatGatewayExtensions /// .WithNatGateway(natGateway); /// /// - [AspireExport("addNatGateway", Description = "Adds an Azure NAT Gateway resource to the application model.")] + [AspireExport(Description = "Adds an Azure NAT Gateway resource to the application model.")] public static IResourceBuilder AddNatGateway( this IDistributedApplicationBuilder builder, [ResourceName] string name) @@ -72,7 +72,7 @@ public static IResourceBuilder AddNatGateway( /// .WithPublicIPAddress(pip); /// /// - [AspireExport("withPublicIPAddress", Description = "Associates an Azure Public IP Address resource with an Azure NAT Gateway resource.")] + [AspireExport(Description = "Associates an Azure Public IP Address resource with an Azure NAT Gateway resource.")] public static IResourceBuilder WithPublicIPAddress( this IResourceBuilder builder, IResourceBuilder publicIPAddress) diff --git a/src/Aspire.Hosting.Azure.Network/AzureNetworkSecurityGroupExtensions.cs b/src/Aspire.Hosting.Azure.Network/AzureNetworkSecurityGroupExtensions.cs index 69cda653762..9dbc99f2375 100644 --- a/src/Aspire.Hosting.Azure.Network/AzureNetworkSecurityGroupExtensions.cs +++ b/src/Aspire.Hosting.Azure.Network/AzureNetworkSecurityGroupExtensions.cs @@ -34,7 +34,7 @@ public static class AzureNetworkSecurityGroupExtensions /// }); /// /// - [AspireExport("addNetworkSecurityGroup", Description = "Adds an Azure Network Security Group resource to the application model.")] + [AspireExport(Description = "Adds an Azure Network Security Group resource to the application model.")] public static IResourceBuilder AddNetworkSecurityGroup( this IDistributedApplicationBuilder builder, [ResourceName] string name) @@ -84,7 +84,7 @@ public static IResourceBuilder AddNetworkSecu /// }); /// /// - [AspireExport("withSecurityRule", Description = "Adds a security rule to an Azure Network Security Group resource.")] + [AspireExport(Description = "Adds a security rule to an Azure Network Security Group resource.")] public static IResourceBuilder WithSecurityRule( this IResourceBuilder builder, AzureSecurityRule rule) diff --git a/src/Aspire.Hosting.Azure.Network/AzurePrivateEndpointExtensions.cs b/src/Aspire.Hosting.Azure.Network/AzurePrivateEndpointExtensions.cs index afd5bbd2ca2..b4e0af5bc25 100644 --- a/src/Aspire.Hosting.Azure.Network/AzurePrivateEndpointExtensions.cs +++ b/src/Aspire.Hosting.Azure.Network/AzurePrivateEndpointExtensions.cs @@ -45,7 +45,7 @@ public static class AzurePrivateEndpointExtensions /// peSubnet.AddPrivateEndpoint(blobs); /// /// - [AspireExport("addPrivateEndpoint", Description = "Adds an Azure Private Endpoint resource to an Azure subnet resource.")] + [AspireExport(Description = "Adds an Azure Private Endpoint resource to an Azure subnet resource.")] public static IResourceBuilder AddPrivateEndpoint( this IResourceBuilder subnet, IResourceBuilder target) diff --git a/src/Aspire.Hosting.Azure.Network/AzurePublicIPAddressExtensions.cs b/src/Aspire.Hosting.Azure.Network/AzurePublicIPAddressExtensions.cs index ebf60aea87f..009bc1f5ca4 100644 --- a/src/Aspire.Hosting.Azure.Network/AzurePublicIPAddressExtensions.cs +++ b/src/Aspire.Hosting.Azure.Network/AzurePublicIPAddressExtensions.cs @@ -30,7 +30,7 @@ public static class AzurePublicIPAddressExtensions /// var pip = builder.AddPublicIPAddress("my-pip"); /// /// - [AspireExport("addPublicIPAddress", Description = "Adds an Azure Public IP Address resource to the application model.")] + [AspireExport(Description = "Adds an Azure Public IP Address resource to the application model.")] public static IResourceBuilder AddPublicIPAddress( this IDistributedApplicationBuilder builder, [ResourceName] string name) diff --git a/src/Aspire.Hosting.Azure.Network/AzureVirtualNetworkExtensions.cs b/src/Aspire.Hosting.Azure.Network/AzureVirtualNetworkExtensions.cs index 30a478cfb50..11d98385255 100644 --- a/src/Aspire.Hosting.Azure.Network/AzureVirtualNetworkExtensions.cs +++ b/src/Aspire.Hosting.Azure.Network/AzureVirtualNetworkExtensions.cs @@ -28,7 +28,7 @@ public static class AzureVirtualNetworkExtensions /// var subnet = vnet.AddSubnet("pe-subnet", "10.0.1.0/24"); /// /// - [AspireExport("addAzureVirtualNetwork", Description = "Adds an Azure Virtual Network resource to the application model.")] + [AspireExport(Description = "Adds an Azure Virtual Network resource to the application model.")] public static IResourceBuilder AddAzureVirtualNetwork( this IDistributedApplicationBuilder builder, [ResourceName] string name, @@ -167,7 +167,7 @@ private static void ConfigureVirtualNetwork(AzureResourceInfrastructure infra) /// var subnet = vnet.AddSubnet("my-subnet", "10.0.1.0/24"); /// /// - [AspireExport("addSubnet", Description = "Adds an Azure subnet resource to an Azure Virtual Network resource.")] + [AspireExport(Description = "Adds an Azure subnet resource to an Azure Virtual Network resource.")] public static IResourceBuilder AddSubnet( this IResourceBuilder builder, [ResourceName] string name, @@ -298,7 +298,7 @@ public static IResourceBuilder WithDelegatedSubnet( /// .WithNatGateway(natGateway); /// /// - [AspireExport("withNatGateway", Description = "Associates an Azure NAT Gateway resource with an Azure subnet resource.")] + [AspireExport(Description = "Associates an Azure NAT Gateway resource with an Azure subnet resource.")] public static IResourceBuilder WithNatGateway( this IResourceBuilder builder, IResourceBuilder natGateway) @@ -330,7 +330,7 @@ public static IResourceBuilder WithNatGateway( /// (, , , ). /// Use either shorthand methods or an explicit NSG, not both. /// - [AspireExport("withNetworkSecurityGroup", Description = "Associates an Azure Network Security Group resource with an Azure subnet resource.")] + [AspireExport(Description = "Associates an Azure Network Security Group resource with an Azure subnet resource.")] public static IResourceBuilder WithNetworkSecurityGroup( this IResourceBuilder builder, IResourceBuilder nsg) @@ -372,7 +372,7 @@ public static IResourceBuilder WithNetworkSecurityGroup( /// .DenyInbound(from: AzureServiceTags.Internet); /// /// - [AspireExport("allowInbound", Description = "Adds an inbound allow rule to the Azure subnet resource's Network Security Group.")] + [AspireExport(Description = "Adds an inbound allow rule to the Azure subnet resource's Network Security Group.")] public static IResourceBuilder AllowInbound( this IResourceBuilder builder, string? port = null, @@ -399,7 +399,7 @@ public static IResourceBuilder AllowInbound( /// /// If no Network Security Group has been associated with the subnet, one is automatically created. /// - [AspireExport("denyInbound", Description = "Adds an inbound deny rule to the Azure subnet resource's Network Security Group.")] + [AspireExport(Description = "Adds an inbound deny rule to the Azure subnet resource's Network Security Group.")] public static IResourceBuilder DenyInbound( this IResourceBuilder builder, string? port = null, @@ -426,7 +426,7 @@ public static IResourceBuilder DenyInbound( /// /// If no Network Security Group has been associated with the subnet, one is automatically created. /// - [AspireExport("allowOutbound", Description = "Adds an outbound allow rule to the Azure subnet resource's Network Security Group.")] + [AspireExport(Description = "Adds an outbound allow rule to the Azure subnet resource's Network Security Group.")] public static IResourceBuilder AllowOutbound( this IResourceBuilder builder, string? port = null, @@ -453,7 +453,7 @@ public static IResourceBuilder AllowOutbound( /// /// If no Network Security Group has been associated with the subnet, one is automatically created. /// - [AspireExport("denyOutbound", Description = "Adds an outbound deny rule to the Azure subnet resource's Network Security Group.")] + [AspireExport(Description = "Adds an outbound deny rule to the Azure subnet resource's Network Security Group.")] public static IResourceBuilder DenyOutbound( this IResourceBuilder builder, string? port = null, diff --git a/src/Aspire.Hosting.Azure.OperationalInsights/AzureLogAnalyticsWorkspaceExtensions.cs b/src/Aspire.Hosting.Azure.OperationalInsights/AzureLogAnalyticsWorkspaceExtensions.cs index ddfba8b3c08..9de6641b878 100644 --- a/src/Aspire.Hosting.Azure.OperationalInsights/AzureLogAnalyticsWorkspaceExtensions.cs +++ b/src/Aspire.Hosting.Azure.OperationalInsights/AzureLogAnalyticsWorkspaceExtensions.cs @@ -19,7 +19,7 @@ public static class AzureLogAnalyticsWorkspaceExtensions /// The . /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// A reference to the . - [AspireExport("addAzureLogAnalyticsWorkspace", Description = "Adds an Azure Log Analytics Workspace resource")] + [AspireExport(Description = "Adds an Azure Log Analytics Workspace resource")] public static IResourceBuilder AddAzureLogAnalyticsWorkspace(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.PostgreSQL/AzurePostgresExtensions.cs b/src/Aspire.Hosting.Azure.PostgreSQL/AzurePostgresExtensions.cs index 8ebd00eed83..c846f7fb973 100644 --- a/src/Aspire.Hosting.Azure.PostgreSQL/AzurePostgresExtensions.cs +++ b/src/Aspire.Hosting.Azure.PostgreSQL/AzurePostgresExtensions.cs @@ -137,7 +137,7 @@ public static IResourceBuilder AsAzurePostgresFlexibleSe /// /// /// - [AspireExport("addAzurePostgresFlexibleServer", Description = "Adds an Azure PostgreSQL Flexible Server resource")] + [AspireExport(Description = "Adds an Azure PostgreSQL Flexible Server resource")] public static IResourceBuilder AddAzurePostgresFlexibleServer(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -158,7 +158,7 @@ public static IResourceBuilder AddAzurePost /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// The name of the database. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addDatabase", Description = "Adds an Azure PostgreSQL database")] + [AspireExport(Description = "Adds an Azure PostgreSQL database")] public static IResourceBuilder AddDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -211,7 +211,7 @@ public static IResourceBuilder AddD /// /// /// - [AspireExport("runAsContainer", Description = "Configures the Azure PostgreSQL Flexible Server resource to run locally in a container", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Azure PostgreSQL Flexible Server resource to run locally in a container", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsContainer(this IResourceBuilder builder, Action>? configureContainer = null) { ArgumentNullException.ThrowIfNull(builder); @@ -291,7 +291,7 @@ private static void RemoveAzureResources(IDistributedApplicationBuilder appBuild /// /// /// - [AspireExport("withPasswordAuthentication", Description = "Configures password authentication for Azure PostgreSQL Flexible Server")] + [AspireExport(Description = "Configures password authentication for Azure PostgreSQL Flexible Server")] public static IResourceBuilder WithPasswordAuthentication( this IResourceBuilder builder, IResourceBuilder? userName = null, @@ -385,7 +385,7 @@ public static IResourceBuilder WithPassword /// /// /// A reference to the . - [AspireExport("withPostgresMcp", Description = "Adds a Postgres MCP server container", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds a Postgres MCP server container", RunSyncOnBackgroundThread = true)] [Experimental("ASPIREPOSTGRES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder WithPostgresMcp( this IResourceBuilder builder, diff --git a/src/Aspire.Hosting.Azure.Redis/AzureManagedRedisExtensions.cs b/src/Aspire.Hosting.Azure.Redis/AzureManagedRedisExtensions.cs index 4af062dd858..e1a4da6dd5a 100644 --- a/src/Aspire.Hosting.Azure.Redis/AzureManagedRedisExtensions.cs +++ b/src/Aspire.Hosting.Azure.Redis/AzureManagedRedisExtensions.cs @@ -43,7 +43,7 @@ public static class AzureManagedRedisExtensions /// /// /// - [AspireExport("addAzureManagedRedis", Description = "Adds an Azure Managed Redis resource")] + [AspireExport(Description = "Adds an Azure Managed Redis resource")] public static IResourceBuilder AddAzureManagedRedis( this IDistributedApplicationBuilder builder, [ResourceName] string name) @@ -81,7 +81,7 @@ public static IResourceBuilder AddAzureManagedRedis( /// /// /// - [AspireExport("runAsContainer", Description = "Configures Azure Managed Redis to run in a local container", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures Azure Managed Redis to run in a local container", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsContainer( this IResourceBuilder builder, Action>? configureContainer = null) @@ -126,7 +126,7 @@ public static IResourceBuilder RunAsContainer( /// /// /// - [AspireExport("withAccessKeyAuthentication", Description = "Configures Azure Managed Redis to use access key authentication")] + [AspireExport(Description = "Configures Azure Managed Redis to use access key authentication")] public static IResourceBuilder WithAccessKeyAuthentication(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.Search/AzureSearchExtensions.cs b/src/Aspire.Hosting.Azure.Search/AzureSearchExtensions.cs index 94c6cf512d7..90af171bd3f 100644 --- a/src/Aspire.Hosting.Azure.Search/AzureSearchExtensions.cs +++ b/src/Aspire.Hosting.Azure.Search/AzureSearchExtensions.cs @@ -30,7 +30,7 @@ public static class AzureSearchExtensions /// /// These can be replaced by calling . /// - [AspireExport("addAzureSearch", Description = "Adds an Azure AI Search service resource")] + [AspireExport(Description = "Adds an Azure AI Search service resource")] public static IResourceBuilder AddAzureSearch(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs b/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs index 9c9e41b7311..13f2d48f272 100644 --- a/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs +++ b/src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs @@ -37,7 +37,7 @@ public static class AzureServiceBusExtensions /// /// These can be replaced by calling . /// - [AspireExport("addAzureServiceBus", Description = "Adds an Azure Service Bus namespace resource")] + [AspireExport(Description = "Adds an Azure Service Bus namespace resource")] public static IResourceBuilder AddAzureServiceBus(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -166,7 +166,7 @@ public static IResourceBuilder AddQueue(this IResourceB /// The name of the queue resource. /// The name of the Service Bus Queue. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addServiceBusQueue", Description = "Adds an Azure Service Bus queue resource")] + [AspireExport(Description = "Adds an Azure Service Bus queue resource")] public static IResourceBuilder AddServiceBusQueue(this IResourceBuilder builder, [ResourceName] string name, string? queueName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -249,7 +249,7 @@ public static IResourceBuilder AddTopic(this IResourceB /// The name of the topic resource. /// The name of the Service Bus Topic. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addServiceBusTopic", Description = "Adds an Azure Service Bus topic resource")] + [AspireExport(Description = "Adds an Azure Service Bus topic resource")] public static IResourceBuilder AddServiceBusTopic(this IResourceBuilder builder, [ResourceName] string name, string? topicName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -319,7 +319,7 @@ public static IResourceBuilder AddSubscription(this IRe /// The name of the subscription resource. /// The name of the Service Bus Subscription. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addServiceBusSubscription", Description = "Adds an Azure Service Bus subscription resource")] + [AspireExport(Description = "Adds an Azure Service Bus subscription resource")] public static IResourceBuilder AddServiceBusSubscription(this IResourceBuilder builder, [ResourceName] string name, string? subscriptionName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -376,7 +376,7 @@ public static IResourceBuilder WithProperti /// /// /// - [AspireExport("runAsEmulator", Description = "Configures the Azure Service Bus resource to run with the local emulator", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Azure Service Bus resource to run with the local emulator", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsEmulator(this IResourceBuilder builder, Action>? configureContainer = null) { ArgumentNullException.ThrowIfNull(builder); @@ -514,7 +514,7 @@ public static IResourceBuilder RunAsEmulator(this IReso /// The builder for the . /// Path to the file on the AppHost where the emulator configuration is located. /// A reference to the . - [AspireExport("withConfigurationFile", Description = "Sets the emulator configuration file path")] + [AspireExport(Description = "Sets the emulator configuration file path")] public static IResourceBuilder WithConfigurationFile(this IResourceBuilder builder, string path) { ArgumentNullException.ThrowIfNull(builder); @@ -563,7 +563,7 @@ public static IResourceBuilder WithConfiguratio /// Builder for the Azure Service Bus emulator container /// The port to bind on the host. If is used, a random port will be assigned. /// A reference to the . - [AspireExport("withHostPort", Description = "Sets the host port for the Service Bus emulator endpoint")] + [AspireExport(Description = "Sets the host port for the Service Bus emulator endpoint")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.SignalR/AzureSignalRExtensions.cs b/src/Aspire.Hosting.Azure.SignalR/AzureSignalRExtensions.cs index 9ff962cfc0f..6fb43480064 100644 --- a/src/Aspire.Hosting.Azure.SignalR/AzureSignalRExtensions.cs +++ b/src/Aspire.Hosting.Azure.SignalR/AzureSignalRExtensions.cs @@ -140,7 +140,7 @@ internal static IResourceBuilder AddAzureSignalRForPolyglo /// The Azure SignalR resource builder. /// Callback that exposes underlying container used for emulation to allow for customization. /// A reference to the . - [AspireExport("runAsEmulator", Description = "Configures an Azure SignalR resource to be emulated. This resource requires an Azure SignalR resource to be added to the application model. Please note that the resource will be emulated in Serverless mode.", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures an Azure SignalR resource to be emulated. This resource requires an Azure SignalR resource to be added to the application model. Please note that the resource will be emulated in Serverless mode.", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsEmulator(this IResourceBuilder builder, Action>? configureContainer = null) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs b/src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs index 28b3ed29161..67ffc145183 100644 --- a/src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs +++ b/src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs @@ -76,7 +76,7 @@ public static IResourceBuilder AsAzureSqlDatabase(this /// The builder for the distributed application. /// The name of the resource. /// A reference to the builder. - [AspireExport("addAzureSqlServer", Description = "Adds an Azure SQL Database server resource")] + [AspireExport(Description = "Adds an Azure SQL Database server resource")] public static IResourceBuilder AddAzureSqlServer(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -106,7 +106,7 @@ public static IResourceBuilder AddAzureSqlServer(this ID /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// The name of the database. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addDatabase", Description = "Adds an Azure SQL database resource")] + [AspireExport(Description = "Adds an Azure SQL database resource")] public static IResourceBuilder AddDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -142,7 +142,7 @@ public static IResourceBuilder AddDatabase(this IResou /// /// The builder for the Azure SQL resource. /// A reference to the . - [AspireExport("withDefaultAzureSku", Description = "Configures the Azure SQL database to use the default Azure SKU")] + [AspireExport(Description = "Configures the Azure SQL database to use the default Azure SKU")] public static IResourceBuilder WithDefaultAzureSku(this IResourceBuilder builder) { builder.Resource.UseDefaultAzureSku = true; @@ -172,7 +172,7 @@ public static IResourceBuilder WithDefaultAzureSku(thi /// /// /// - [AspireExport("runAsContainer", Description = "Configures the Azure SQL server to run locally in a SQL Server container", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Azure SQL server to run locally in a SQL Server container", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsContainer(this IResourceBuilder builder, Action>? configureContainer = null) { ArgumentNullException.ThrowIfNull(builder); @@ -389,7 +389,7 @@ private static SqlServer CreateSqlServerResourceOnly(AzureResourceInfrastructure /// peSubnet.AddPrivateEndpoint(sql); /// /// - [AspireExport("withAdminDeploymentScriptSubnet", Description = "Configures the Azure SQL server to use a specific subnet for deployment scripts")] + [AspireExport(Description = "Configures the Azure SQL server to use a specific subnet for deployment scripts")] [Experimental("ASPIREAZURE003", UrlFormat = "https://aka.ms/dotnet/aspire/diagnostics#{0}")] public static IResourceBuilder WithAdminDeploymentScriptSubnet( this IResourceBuilder builder, @@ -438,7 +438,7 @@ public static IResourceBuilder WithAdminDeploymentScript /// peSubnet.AddPrivateEndpoint(sql); /// /// - [AspireExport("withAdminDeploymentScriptStorage", Description = "Configures the Azure SQL server to use a specific storage account for deployment scripts")] + [AspireExport(Description = "Configures the Azure SQL server to use a specific storage account for deployment scripts")] [Experimental("ASPIREAZURE003", UrlFormat = "https://aka.ms/dotnet/aspire/diagnostics#{0}")] public static IResourceBuilder WithAdminDeploymentScriptStorage( this IResourceBuilder builder, diff --git a/src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs b/src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs index 35399dfeff8..dde3960e99f 100644 --- a/src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs +++ b/src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs @@ -36,7 +36,7 @@ public static class AzureStorageExtensions /// /// These can be replaced by calling . /// - [AspireExport("addAzureStorage", Description = "Adds an Azure Storage resource")] + [AspireExport(Description = "Adds an Azure Storage resource")] public static IResourceBuilder AddAzureStorage(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -174,7 +174,7 @@ public static IResourceBuilder AddAzureStorage(this IDistr /// The Azure storage resource builder. /// Callback that exposes underlying container used for emulation to allow for customization. /// A reference to the . - [AspireExport("runAsEmulator", Description = "Configures the Azure Storage resource to be emulated using Azurite", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures the Azure Storage resource to be emulated using Azurite", RunSyncOnBackgroundThread = true)] public static IResourceBuilder RunAsEmulator(this IResourceBuilder builder, Action>? configureContainer = null) { ArgumentNullException.ThrowIfNull(builder); @@ -269,7 +269,7 @@ public static IResourceBuilder RunAsEmulator(this IResourc /// Relative path to the AppHost where emulator storage is persisted between runs. Defaults to the path '.azurite/{builder.Resource.Name}' /// A flag that indicates if this is a read-only mount. /// A builder for the . - [AspireExport("withDataBindMount", Description = "Adds a bind mount for the data folder to an Azure Storage emulator resource")] + [AspireExport(Description = "Adds a bind mount for the data folder to an Azure Storage emulator resource")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string? path = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -284,7 +284,7 @@ public static IResourceBuilder WithDataBindMount(t /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A flag that indicates if this is a read-only volume. /// A builder for the . - [AspireExport("withDataVolume", Description = "Adds a named volume for the data folder to an Azure Storage emulator resource")] + [AspireExport(Description = "Adds a named volume for the data folder to an Azure Storage emulator resource")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -298,7 +298,7 @@ public static IResourceBuilder WithDataVolume(this /// Storage emulator resource builder. /// Host port to use. /// - [AspireExport("withBlobPort", Description = "Sets the host port for blob requests on the storage emulator")] + [AspireExport(Description = "Sets the host port for blob requests on the storage emulator")] public static IResourceBuilder WithBlobPort(this IResourceBuilder builder, int port) { ArgumentNullException.ThrowIfNull(builder); @@ -315,7 +315,7 @@ public static IResourceBuilder WithBlobPort(this I /// Storage emulator resource builder. /// Host port to use. /// - [AspireExport("withQueuePort", Description = "Sets the host port for queue requests on the storage emulator")] + [AspireExport(Description = "Sets the host port for queue requests on the storage emulator")] public static IResourceBuilder WithQueuePort(this IResourceBuilder builder, int port) { ArgumentNullException.ThrowIfNull(builder); @@ -332,7 +332,7 @@ public static IResourceBuilder WithQueuePort(this /// Storage emulator resource builder. /// Host port to use. /// An for the . - [AspireExport("withTablePort", Description = "Sets the host port for table requests on the storage emulator")] + [AspireExport(Description = "Sets the host port for table requests on the storage emulator")] public static IResourceBuilder WithTablePort(this IResourceBuilder builder, int port) { ArgumentNullException.ThrowIfNull(builder); @@ -349,7 +349,7 @@ public static IResourceBuilder WithTablePort(this /// Storage emulator resource builder. /// Whether to enable API version check or not. Default is true. /// An for the . - [AspireExport("withApiVersionCheck", Description = "Configures whether the emulator checks API version validity")] + [AspireExport(Description = "Configures whether the emulator checks API version validity")] public static IResourceBuilder WithApiVersionCheck(this IResourceBuilder builder, bool enable = true) { ArgumentNullException.ThrowIfNull(builder); @@ -374,7 +374,7 @@ public static IResourceBuilder WithApiVersionCheck /// The for . /// The name of the resource. /// An for the . - [AspireExport("addBlobs", Description = "Adds an Azure Blob Storage resource")] + [AspireExport(Description = "Adds an Azure Blob Storage resource")] public static IResourceBuilder AddBlobs(this IResourceBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -396,7 +396,7 @@ public static IResourceBuilder AddBlobs(this IResource /// The for . /// The name of the resource. /// An for the . - [AspireExport("addDataLake", Description = "Adds an Azure Data Lake Storage resource")] + [AspireExport(Description = "Adds an Azure Data Lake Storage resource")] public static IResourceBuilder AddDataLake(this IResourceBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -461,7 +461,7 @@ private static IResourceBuilder GetDataLakeService /// The name of the resource. /// The name of the blob container. /// An for the . - [AspireExport("addBlobContainer", Description = "Adds an Azure Blob Storage container resource")] + [AspireExport(Description = "Adds an Azure Blob Storage container resource")] public static IResourceBuilder AddBlobContainer(this IResourceBuilder builder, [ResourceName] string name, string? blobContainerName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -498,7 +498,7 @@ public static IResourceBuilder AddBlobContain /// The name of the resource. /// The name of the data lake file system. /// An for the . - [AspireExport("addDataLakeFileSystem", Description = "Adds an Azure Data Lake Storage file system resource")] + [AspireExport(Description = "Adds an Azure Data Lake Storage file system resource")] public static IResourceBuilder AddDataLakeFileSystem(this IResourceBuilder builder, [ResourceName] string name, string? dataLakeFileSystemName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -557,7 +557,7 @@ public static IResourceBuilder AddBlobContain /// The for . /// The name of the resource. /// An for the . - [AspireExport("addTables", Description = "Adds an Azure Table Storage resource")] + [AspireExport(Description = "Adds an Azure Table Storage resource")] public static IResourceBuilder AddTables(this IResourceBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -572,7 +572,7 @@ public static IResourceBuilder AddTables(this IResour /// The for . /// The name of the resource. /// An for the . - [AspireExport("addQueues", Description = "Adds an Azure Queue Storage resource")] + [AspireExport(Description = "Adds an Azure Queue Storage resource")] public static IResourceBuilder AddQueues(this IResourceBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -609,7 +609,7 @@ private static IResourceBuilder GetQueueService(this /// The name of the resource. /// The name of the queue. /// An for the . - [AspireExport("addQueue", Description = "Adds an Azure Storage queue resource")] + [AspireExport(Description = "Adds an Azure Storage queue resource")] public static IResourceBuilder AddQueue(this IResourceBuilder builder, [ResourceName] string name, string? queueName = null) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure.WebPubSub/AzureWebPubSubExtensions.cs b/src/Aspire.Hosting.Azure.WebPubSub/AzureWebPubSubExtensions.cs index a20aaa71aee..8827f3571ce 100644 --- a/src/Aspire.Hosting.Azure.WebPubSub/AzureWebPubSubExtensions.cs +++ b/src/Aspire.Hosting.Azure.WebPubSub/AzureWebPubSubExtensions.cs @@ -31,7 +31,7 @@ public static class AzureWebPubSubExtensions /// /// These can be replaced by calling . /// - [AspireExport("addAzureWebPubSub", Description = "Adds an Azure Web PubSub resource to the distributed application model.")] + [AspireExport(Description = "Adds an Azure Web PubSub resource to the distributed application model.")] public static IResourceBuilder AddAzureWebPubSub(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -171,7 +171,7 @@ public static IResourceBuilder AddHub(this IResourceB /// The name of the Azure WebPubSub Hub resource. /// The name of the Azure WebPubSub Hub. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addHub", Description = "Adds a hub to the Azure Web PubSub resource.")] + [AspireExport(Description = "Adds a hub to the Azure Web PubSub resource.")] public static IResourceBuilder AddHub(this IResourceBuilder builder, [ResourceName] string name, string? hubName = null) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Azure/AzureBicepResourceExtensions.cs b/src/Aspire.Hosting.Azure/AzureBicepResourceExtensions.cs index 5441edbd81e..51df89c12de 100644 --- a/src/Aspire.Hosting.Azure/AzureBicepResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure/AzureBicepResourceExtensions.cs @@ -20,7 +20,7 @@ public static class AzureBicepResourceExtensions /// The name of the resource. This name will be used as the deployment name. /// The path to the bicep file on disk. This path is relative to the apphost's project directory. /// An . - [AspireExport("addBicepTemplate", Description = "Adds an Azure Bicep template resource from a file")] + [AspireExport(Description = "Adds an Azure Bicep template resource from a file")] public static IResourceBuilder AddBicepTemplate(this IDistributedApplicationBuilder builder, [ResourceName] string name, string bicepFile) { builder.AddAzureProvisioning(); @@ -37,7 +37,7 @@ public static IResourceBuilder AddBicepTemplate(this IDistri /// The name of the resource. This name will be used as the deployment name. /// A string that represents a snippet of bicep. /// An . - [AspireExport("addBicepTemplateString", Description = "Adds an Azure Bicep template resource from inline Bicep content")] + [AspireExport(Description = "Adds an Azure Bicep template resource from inline Bicep content")] public static IResourceBuilder AddBicepTemplateString(this IDistributedApplicationBuilder builder, [ResourceName] string name, string bicepContent) { builder.AddAzureProvisioning(); @@ -52,7 +52,7 @@ public static IResourceBuilder AddBicepTemplateString(this I /// The resource builder. /// Name of the output. /// A that represents the output. - [AspireExport("getOutput", Description = "Gets an output reference from an Azure Bicep template resource")] + [AspireExport(Description = "Gets an output reference from an Azure Bicep template resource")] public static BicepOutputReference GetOutput(this IResourceBuilder builder, string name) { return new BicepOutputReference(name, builder.Resource); @@ -160,7 +160,7 @@ internal static IResourceBuilder WithEnvironmentFromKeyVaultSecretShim(thi /// The resource builder. /// The name of the input. /// An . - [AspireExport("withParameter", Description = "Adds a Bicep parameter without a value")] + [AspireExport(Description = "Adds a Bicep parameter without a value")] public static IResourceBuilder WithParameter(this IResourceBuilder builder, string name) where T : AzureBicepResource { diff --git a/src/Aspire.Hosting.Azure/AzureEnvironmentResourceExtensions.cs b/src/Aspire.Hosting.Azure/AzureEnvironmentResourceExtensions.cs index f50ea9a0c24..f0dda26b617 100644 --- a/src/Aspire.Hosting.Azure/AzureEnvironmentResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure/AzureEnvironmentResourceExtensions.cs @@ -16,7 +16,7 @@ public static class AzureEnvironmentResourceExtensions /// /// The . /// The . - [AspireExport("addAzureEnvironment", Description = "Adds the shared Azure environment resource to the application model")] + [AspireExport(Description = "Adds the shared Azure environment resource to the application model")] [Experimental("ASPIREAZURE001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder AddAzureEnvironment(this IDistributedApplicationBuilder builder) { @@ -58,7 +58,7 @@ public static IResourceBuilder AddAzureEnvironment(thi /// This method is used to set the location of the Azure environment resource. /// The location is used to determine where the resources will be deployed. /// - [AspireExport("withLocation", Description = "Sets the Azure location for the shared Azure environment resource")] + [AspireExport(Description = "Sets the Azure location for the shared Azure environment resource")] [Experimental("ASPIREAZURE001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder WithLocation( this IResourceBuilder builder, @@ -82,7 +82,7 @@ public static IResourceBuilder WithLocation( /// This method is used to set the resource group name of the Azure environment resource. /// The resource group name is used to determine where the resources will be deployed. /// - [AspireExport("withResourceGroup", Description = "Sets the Azure resource group for the shared Azure environment resource")] + [AspireExport(Description = "Sets the Azure resource group for the shared Azure environment resource")] [Experimental("ASPIREAZURE001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder WithResourceGroup( this IResourceBuilder builder, diff --git a/src/Aspire.Hosting.Azure/AzureProvisioningResourceExtensions.cs b/src/Aspire.Hosting.Azure/AzureProvisioningResourceExtensions.cs index 2ea988e3767..f4a4915614c 100644 --- a/src/Aspire.Hosting.Azure/AzureProvisioningResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure/AzureProvisioningResourceExtensions.cs @@ -21,7 +21,7 @@ public static class AzureProvisioningResourceExtensions /// The name of the resource being added. /// A callback used to configure the infrastructure resource. /// A resource builder for the that can be used for further configuration. - [AspireExport("addAzureInfrastructure", Description = "Adds an Azure provisioning resource to the application model")] + [AspireExport(Description = "Adds an Azure provisioning resource to the application model")] public static IResourceBuilder AddAzureInfrastructure(this IDistributedApplicationBuilder builder, [ResourceName] string name, Action configureInfrastructure) { builder.AddAzureProvisioning(); @@ -37,7 +37,7 @@ public static IResourceBuilder AddAzureInfrastructure /// The resource builder. /// The configuration callback. /// The resource builder. - [AspireExport("configureInfrastructure", Description = "Configures the Azure provisioning infrastructure callback")] + [AspireExport(Description = "Configures the Azure provisioning infrastructure callback")] public static IResourceBuilder ConfigureInfrastructure(this IResourceBuilder builder, Action configure) where T : AzureProvisioningResource { diff --git a/src/Aspire.Hosting.Azure/AzureResourceExtensions.cs b/src/Aspire.Hosting.Azure/AzureResourceExtensions.cs index 7a23a5e660c..60a5fd54b88 100644 --- a/src/Aspire.Hosting.Azure/AzureResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure/AzureResourceExtensions.cs @@ -18,7 +18,7 @@ public static class AzureResourceExtensions /// The resource type. /// The resource builder. /// The configured . - [AspireExport("publishAsConnectionString", Description = "Publishes an Azure resource to the manifest as a connection string")] + [AspireExport(Description = "Publishes an Azure resource to the manifest as a connection string")] public static IResourceBuilder PublishAsConnectionString(this IResourceBuilder builder) where T : IAzureResource, IResourceWithConnectionString { @@ -31,7 +31,7 @@ public static IResourceBuilder PublishAsConnectionString(this IResourceBui /// /// The Azure resource. /// A valid Bicep identifier. - [AspireExport("getBicepIdentifier", Description = "Gets the normalized Bicep identifier for an Azure resource")] + [AspireExport(Description = "Gets the normalized Bicep identifier for an Azure resource")] public static string GetBicepIdentifier(this IAzureResource resource) => Infrastructure.NormalizeBicepIdentifier(resource.Name); @@ -59,7 +59,7 @@ public static string GetBicepIdentifier(this IAzureResource resource) => /// .WithReference(keyVault); /// /// - [AspireExport("clearDefaultRoleAssignments", Description = "Clears the default Azure role assignments from a resource")] + [AspireExport(Description = "Clears the default Azure role assignments from a resource")] public static IResourceBuilder ClearDefaultRoleAssignments(this IResourceBuilder builder) where T : IAzureResource { diff --git a/src/Aspire.Hosting.Azure/AzureUserAssignedIdentityExtensions.cs b/src/Aspire.Hosting.Azure/AzureUserAssignedIdentityExtensions.cs index 98a1f870b60..8c7524f095c 100644 --- a/src/Aspire.Hosting.Azure/AzureUserAssignedIdentityExtensions.cs +++ b/src/Aspire.Hosting.Azure/AzureUserAssignedIdentityExtensions.cs @@ -23,7 +23,7 @@ public static class AzureUserAssignedIdentityExtensions /// The resource is added to the infrastructure only if the application is not in run mode. /// /// A reference to the builder. - [AspireExport("addAzureUserAssignedIdentity", Description = "Adds an Azure user-assigned identity resource")] + [AspireExport(Description = "Adds an Azure user-assigned identity resource")] public static IResourceBuilder AddAzureUserAssignedIdentity( this IDistributedApplicationBuilder builder, string name) diff --git a/src/Aspire.Hosting.Azure/ExistingAzureResourceExtensions.cs b/src/Aspire.Hosting.Azure/ExistingAzureResourceExtensions.cs index 4d6a4f98389..03dd5dd6913 100644 --- a/src/Aspire.Hosting.Azure/ExistingAzureResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure/ExistingAzureResourceExtensions.cs @@ -67,7 +67,7 @@ public static IResourceBuilder RunAsExisting(this IResourceBuilder buil /// The name of the existing resource. /// The name of the existing resource group, or to use the current resource group. /// The resource builder with the existing resource annotation added. - [AspireExport("runAsExisting", Description = "Marks an Azure resource as existing in run mode")] + [AspireExport(Description = "Marks an Azure resource as existing in run mode")] public static IResourceBuilder RunAsExisting(this IResourceBuilder builder, string name, string? resourceGroup) where T : IAzureResource { @@ -111,7 +111,7 @@ public static IResourceBuilder PublishAsExisting(this IResourceBuilder /// The name of the existing resource. /// The name of the existing resource group, or to use the current resource group. /// The resource builder with the existing resource annotation added. - [AspireExport("publishAsExisting", Description = "Marks an Azure resource as existing in publish mode")] + [AspireExport(Description = "Marks an Azure resource as existing in publish mode")] public static IResourceBuilder PublishAsExisting(this IResourceBuilder builder, string name, string? resourceGroup) where T : IAzureResource { diff --git a/src/Aspire.Hosting.Azure/Provisioning/AzureProvisionerExtensions.cs b/src/Aspire.Hosting.Azure/Provisioning/AzureProvisionerExtensions.cs index c2924ef1bc6..ac7abe6fb4b 100644 --- a/src/Aspire.Hosting.Azure/Provisioning/AzureProvisionerExtensions.cs +++ b/src/Aspire.Hosting.Azure/Provisioning/AzureProvisionerExtensions.cs @@ -21,7 +21,7 @@ public static class AzureProvisionerExtensions /// /// The distributed application builder. /// The distributed application builder. - [AspireExport("addAzureProvisioning", Description = "Adds Azure provisioning services to the distributed application builder")] + [AspireExport(Description = "Adds Azure provisioning services to the distributed application builder")] public static IDistributedApplicationBuilder AddAzureProvisioning(this IDistributedApplicationBuilder builder) { // Always add the Azure environment, even if the user doesn't explicitly add it. diff --git a/src/Aspire.Hosting.DevTunnels/DevTunnelResourceBuilderExtensions.cs b/src/Aspire.Hosting.DevTunnels/DevTunnelResourceBuilderExtensions.cs index 17956d932f5..379cc8596b5 100644 --- a/src/Aspire.Hosting.DevTunnels/DevTunnelResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting.DevTunnels/DevTunnelResourceBuilderExtensions.cs @@ -357,7 +357,7 @@ public static IResourceBuilder WithReference( /// /// The resource builder. /// The resource builder. - [AspireExport("withAnonymousAccess", Description = "Configures the dev tunnel to allow anonymous access.")] + [AspireExport(Description = "Configures the dev tunnel to allow anonymous access.")] public static IResourceBuilder WithAnonymousAccess(this IResourceBuilder tunnelBuilder) { tunnelBuilder.Resource.Options.AllowAnonymous = true; diff --git a/src/Aspire.Hosting.Docker/DockerComposeAspireDashboardResourceBuilderExtensions.cs b/src/Aspire.Hosting.Docker/DockerComposeAspireDashboardResourceBuilderExtensions.cs index 3aefabaa584..946bcd1cbc5 100644 --- a/src/Aspire.Hosting.Docker/DockerComposeAspireDashboardResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting.Docker/DockerComposeAspireDashboardResourceBuilderExtensions.cs @@ -52,7 +52,7 @@ internal static IResourceBuilder CreateDas /// /// The instance for chaining. /// - [AspireExport("withHostPort", Description = "Sets the host port for the Aspire dashboard")] + [AspireExport(Description = "Sets the host port for the Aspire dashboard")] public static IResourceBuilder WithHostPort( this IResourceBuilder builder, int? port = null) @@ -75,7 +75,7 @@ public static IResourceBuilder WithHostPor /// container. When enabled, the dashboard will process X-Forwarded-Host and X-Forwarded-Proto /// headers which is required when the dashboard is accessed through a reverse proxy or load balancer. /// - [AspireExport("withForwardedHeaders", Description = "Enables or disables forwarded headers support for the Aspire dashboard")] + [AspireExport(Description = "Enables or disables forwarded headers support for the Aspire dashboard")] public static IResourceBuilder WithForwardedHeaders( this IResourceBuilder builder, bool enabled = true) diff --git a/src/Aspire.Hosting.Docker/DockerComposeEnvironmentExtensions.cs b/src/Aspire.Hosting.Docker/DockerComposeEnvironmentExtensions.cs index a2fbf24673e..57b83a1be9b 100644 --- a/src/Aspire.Hosting.Docker/DockerComposeEnvironmentExtensions.cs +++ b/src/Aspire.Hosting.Docker/DockerComposeEnvironmentExtensions.cs @@ -26,7 +26,7 @@ internal static IDistributedApplicationBuilder AddDockerComposeInfrastructureCor /// The . /// The name of the Docker Compose environment resource. /// A reference to the . - [AspireExport("addDockerComposeEnvironment", Description = "Adds a Docker Compose publishing environment")] + [AspireExport(Description = "Adds a Docker Compose publishing environment")] public static IResourceBuilder AddDockerComposeEnvironment( this IDistributedApplicationBuilder builder, [ResourceName] string name) @@ -62,7 +62,7 @@ public static IResourceBuilder AddDockerCompos /// The Docker Compose environment resource builder. /// A method that can be used for customizing the . /// A reference to the . - [AspireExport("withProperties", Description = "Configures properties of the Docker Compose environment", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures properties of the Docker Compose environment", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithProperties(this IResourceBuilder builder, Action configure) { ArgumentNullException.ThrowIfNull(builder); @@ -119,7 +119,7 @@ public static IResourceBuilder ConfigureEnvFil /// The Docker Compose environment resource builder. /// Whether to enable the dashboard. Default is true. /// A reference to the . - [AspireExport("withDashboard", Description = "Enables or disables the Aspire dashboard for the Docker Compose environment")] + [AspireExport(Description = "Enables or disables the Aspire dashboard for the Docker Compose environment")] public static IResourceBuilder WithDashboard(this IResourceBuilder builder, bool enabled = true) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Docker/DockerComposeServiceExtensions.cs b/src/Aspire.Hosting.Docker/DockerComposeServiceExtensions.cs index 1fd5adf814a..c7a09614ca3 100644 --- a/src/Aspire.Hosting.Docker/DockerComposeServiceExtensions.cs +++ b/src/Aspire.Hosting.Docker/DockerComposeServiceExtensions.cs @@ -31,7 +31,7 @@ public static class DockerComposeServiceExtensions /// /// /// - [AspireExport("publishAsDockerComposeService", Description = "Publishes the resource as a Docker Compose service with custom service configuration")] + [AspireExport(Description = "Publishes the resource as a Docker Compose service with custom service configuration")] public static IResourceBuilder PublishAsDockerComposeService(this IResourceBuilder builder, Action configure) where T : IComputeResource { diff --git a/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs b/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs index 4df9cbc9259..5a0df539da7 100644 --- a/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs @@ -147,7 +147,7 @@ public static IResourceBuilder WithMigrationNamespace(this /// remains the original project. /// /// - [AspireExport] + [AspireExport("withMigrationsProjectFromPath", MethodName = "withMigrationsProject", Description = "Configures a separate project containing the migrations using a path")] public static IResourceBuilder WithMigrationsProject(this IResourceBuilder builder, string projectPath) { ArgumentException.ThrowIfNullOrEmpty(projectPath); diff --git a/src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs b/src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs index cde9db9fb25..ccd8583e84b 100644 --- a/src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting.EntityFrameworkCore/EFResourceBuilderExtensions.cs @@ -45,7 +45,7 @@ private static string GetShortTypeName(string? fullTypeName) /// using runtime-discovered context types. /// /// - [AspireExport] + [AspireExport("addEFMigrationsWithContextType", MethodName = "addEFMigrations", Description = "Adds EF Core migration management for a specific DbContext type identified by name")] public static IResourceBuilder AddEFMigrations( this IResourceBuilder builder, [ResourceName] string name, diff --git a/src/Aspire.Hosting.Foundry/FoundryExtensions.cs b/src/Aspire.Hosting.Foundry/FoundryExtensions.cs index ddd6f2e8893..1ec8ecdca5a 100644 --- a/src/Aspire.Hosting.Foundry/FoundryExtensions.cs +++ b/src/Aspire.Hosting.Foundry/FoundryExtensions.cs @@ -31,7 +31,7 @@ public static class FoundryExtensions /// The . /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// A reference to the . - [AspireExport("addFoundry", Description = "Adds a Microsoft Foundry resource to the distributed application model.")] + [AspireExport(Description = "Adds a Microsoft Foundry resource to the distributed application model.")] public static IResourceBuilder AddFoundry(this IDistributedApplicationBuilder builder, [ResourceName] string name) { builder.AddAzureProvisioning(); @@ -51,7 +51,7 @@ public static IResourceBuilder AddFoundry(this IDistributedAppl /// The version of the model to deploy. /// The format of the model to deploy. /// A reference to the . - [AspireExport("addDeployment", Description = "Adds a Microsoft Foundry deployment resource to a Microsoft Foundry resource.")] + [AspireExport(Description = "Adds a Microsoft Foundry deployment resource to a Microsoft Foundry resource.")] public static IResourceBuilder AddDeployment(this IResourceBuilder builder, [ResourceName] string name, string modelName, string modelVersion, string format) { ArgumentNullException.ThrowIfNull(builder); @@ -130,7 +130,7 @@ public static IResourceBuilder WithProperties(this IR /// /// The distributed application builder. /// A resource builder for the Foundry Local resource. - [AspireExport("runAsFoundryLocal", Description = "Configures the Microsoft Foundry resource to run by using Foundry Local.")] + [AspireExport(Description = "Configures the Microsoft Foundry resource to run by using Foundry Local.")] public static IResourceBuilder RunAsFoundryLocal(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder, nameof(builder)); diff --git a/src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs b/src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs index ea922e4a99a..4fc7999000c 100644 --- a/src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs +++ b/src/Aspire.Hosting.Foundry/HostedAgent/HostedAgentBuilderExtension.cs @@ -317,7 +317,7 @@ await interactionService.PromptMessageBoxAsync( /// If a project resource is not provided, the method will attempt to find an existing /// Microsoft Foundry project resource in the application model. /// - [AspireExport("addAndPublishPromptAgent", Description = "Adds and publishes a prompt agent to a Microsoft Foundry project.")] + [AspireExport(Description = "Adds and publishes a prompt agent to a Microsoft Foundry project.")] public static IResourceBuilder AddAndPublishPromptAgent( this IResourceBuilder project, IResourceBuilder model, [ResourceName] string name, string? instructions) { diff --git a/src/Aspire.Hosting.Foundry/Project/ProjectBuilderExtension.cs b/src/Aspire.Hosting.Foundry/Project/ProjectBuilderExtension.cs index 7a4ad61dcae..7ecd2a05ffb 100644 --- a/src/Aspire.Hosting.Foundry/Project/ProjectBuilderExtension.cs +++ b/src/Aspire.Hosting.Foundry/Project/ProjectBuilderExtension.cs @@ -34,7 +34,7 @@ public static class AzureCognitiveServicesProjectExtensions /// The for the parent Microsoft Foundry account resource. /// The name of the Microsoft Foundry project resource. /// A reference to the for the Microsoft Foundry project resource. - [AspireExport("addProject", Description = "Adds a Microsoft Foundry project resource to a Microsoft Foundry resource.")] + [AspireExport(Description = "Adds a Microsoft Foundry project resource to a Microsoft Foundry resource.")] public static IResourceBuilder AddProject( this IResourceBuilder builder, string name) @@ -57,7 +57,7 @@ public static IResourceBuilder AddProject /// Associates a container registry with the Microsoft Foundry project resource for /// publishing and locating hosted agents. /// - [AspireExport("withContainerRegistry", Description = "Associates a container registry with a Microsoft Foundry project resource.")] + [AspireExport(Description = "Associates a container registry with a Microsoft Foundry project resource.")] public static IResourceBuilder WithContainerRegistry( this IResourceBuilder builder, IResourceBuilder registryBuilder) @@ -114,7 +114,7 @@ public static IResourceBuilder WithReference(this IR /// The Key Vault resource to associate with the project. /// A reference to the for chaining. /// Thrown when the project already has a Key Vault connection configured. - [AspireExport("withKeyVault", Description = "Associates an Azure Key Vault resource with a Microsoft Foundry project.")] + [AspireExport(Description = "Associates an Azure Key Vault resource with a Microsoft Foundry project.")] public static IResourceBuilder WithKeyVault( this IResourceBuilder builder, IResourceBuilder keyVault) @@ -139,7 +139,7 @@ public static IResourceBuilder WithKeyVau /// The resource builder for the Microsoft Foundry project. /// The Application Insights resource to associate with the project. /// A reference to the for chaining. - [AspireExport("withAppInsights", Description = "Associates an Azure Application Insights resource with a Microsoft Foundry project.")] + [AspireExport(Description = "Associates an Azure Application Insights resource with a Microsoft Foundry project.")] public static IResourceBuilder WithAppInsights( this IResourceBuilder builder, IResourceBuilder appInsights) @@ -199,7 +199,7 @@ public static IResourceBuilder AddModelDeployment( /// /// Adds a model deployment to the parent Microsoft Foundry resource of the Microsoft Foundry project. /// - [AspireExport("addModelDeployment", Description = "Adds a model deployment to the parent Microsoft Foundry resource.")] + [AspireExport(Description = "Adds a model deployment to the parent Microsoft Foundry resource.")] public static IResourceBuilder AddModelDeployment( this IResourceBuilder builder, [ResourceName] string name, diff --git a/src/Aspire.Hosting.Garnet/GarnetBuilderExtensions.cs b/src/Aspire.Hosting.Garnet/GarnetBuilderExtensions.cs index af69e357a91..b5dc83e4c33 100644 --- a/src/Aspire.Hosting.Garnet/GarnetBuilderExtensions.cs +++ b/src/Aspire.Hosting.Garnet/GarnetBuilderExtensions.cs @@ -202,7 +202,7 @@ internal static IResourceBuilder AddGarnetForPolyglot( /// Defaults to false. /// /// The . - [AspireExport("withDataVolume", Description = "Adds a persistent data volume to the Garnet resource.")] + [AspireExport(Description = "Adds a persistent data volume to the Garnet resource.")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { @@ -238,7 +238,7 @@ public static IResourceBuilder WithDataVolume(this IResourceBuil /// Defaults to false. /// /// The . - [AspireExport("withDataBindMount", Description = "Mounts a host directory as the Garnet data directory.")] + [AspireExport(Description = "Mounts a host directory as the Garnet data directory.")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { @@ -292,7 +292,7 @@ public static IResourceBuilder WithPersistence(this IResourceBui /// The resource builder. /// The interval between snapshot exports. Defaults to 60 seconds. /// The . - [AspireExport("withPersistence", Description = "Configures snapshot persistence for the Garnet resource.")] + [AspireExport(Description = "Configures snapshot persistence for the Garnet resource.")] public static IResourceBuilder WithPersistence(this IResourceBuilder builder, TimeSpan? interval = null) { diff --git a/src/Aspire.Hosting.GitHub.Models/GitHubModelsExtensions.cs b/src/Aspire.Hosting.GitHub.Models/GitHubModelsExtensions.cs index 65138394114..38eda6573a0 100644 --- a/src/Aspire.Hosting.GitHub.Models/GitHubModelsExtensions.cs +++ b/src/Aspire.Hosting.GitHub.Models/GitHubModelsExtensions.cs @@ -115,7 +115,7 @@ public static IResourceBuilder AddGitHubModel(this IDistrib /// The known model name from the enumeration. /// The organization login associated with the organization to which the request is to be attributed. /// A reference to the . - [AspireExport("addGitHubModel", Description = "Adds a GitHub Model resource to the distributed application model.")] + [AspireExport(Description = "Adds a GitHub Model resource to the distributed application model.")] internal static IResourceBuilder AddGitHubModel(this IDistributedApplicationBuilder builder, [ResourceName] string name, GitHubModelName model, IResourceBuilder? organization = null) { return AddGitHubModel(builder, name, GitHubModel.GetModelId(model), organization); @@ -129,7 +129,7 @@ internal static IResourceBuilder AddGitHubModel(this IDistr /// The model identifier string, for example "openai/gpt-4o". /// The organization login associated with the organization to which the request is to be attributed. /// A reference to the . - [AspireExport("addGitHubModelById", Description = "Adds a GitHub Model resource using a model identifier string.")] + [AspireExport(Description = "Adds a GitHub Model resource using a model identifier string.")] internal static IResourceBuilder AddGitHubModelById(this IDistributedApplicationBuilder builder, [ResourceName] string name, string modelId, IResourceBuilder? organization = null) { return AddGitHubModel(builder, name, modelId, organization); @@ -142,7 +142,7 @@ internal static IResourceBuilder AddGitHubModelById(this ID /// The API key parameter. /// The resource builder. /// Thrown when the provided parameter is not marked as secret. - [AspireExport("withApiKey", Description = "Configures the API key for the GitHub Model resource.")] + [AspireExport(Description = "Configures the API key for the GitHub Model resource.")] public static IResourceBuilder WithApiKey(this IResourceBuilder builder, IResourceBuilder apiKey) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Integration.Analyzers/AnalyzerReleases.Unshipped.md b/src/Aspire.Hosting.Integration.Analyzers/AnalyzerReleases.Unshipped.md index ab70a35f04b..8965c8bd047 100644 --- a/src/Aspire.Hosting.Integration.Analyzers/AnalyzerReleases.Unshipped.md +++ b/src/Aspire.Hosting.Integration.Analyzers/AnalyzerReleases.Unshipped.md @@ -15,3 +15,4 @@ ASPIREEXPORT007 | Design | Warning | AspireExportAnalyzer, [Documentation](https ASPIREEXPORT008 | Design | Warning | AspireExportAnalyzer, [Documentation](https://aka.ms/aspire/diagnostics/ASPIREEXPORT008) ASPIREEXPORT009 | Design | Warning | AspireExportAnalyzer, [Documentation](https://aka.ms/aspire/diagnostics/ASPIREEXPORT009) ASPIREEXPORT010 | Design | Warning | AspireExportAnalyzer, [Documentation](https://aka.ms/aspire/diagnostics/ASPIREEXPORT010) +ASPIREEXPORT011 | Design | Warning | AspireExportAnalyzer, [Documentation](https://aka.ms/aspire/diagnostics/ASPIREEXPORT011) diff --git a/src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.Diagnostics.cs b/src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.Diagnostics.cs index 3f23a262404..73d5475f95c 100644 --- a/src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.Diagnostics.cs +++ b/src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.Diagnostics.cs @@ -111,6 +111,16 @@ internal static class Diagnostics isEnabledByDefault: true, helpLinkUri: $"https://aka.ms/aspire/diagnostics/{ExportedSyncDelegateInvokedInlineId}"); + private const string RedundantExportIdId = "ASPIREEXPORT011"; + internal static readonly DiagnosticDescriptor s_redundantExportId = new( + id: RedundantExportIdId, + title: "Redundant AspireExport ID", + messageFormat: "Export ID '{0}' on method '{1}' is redundant because it matches the convention-derived name. Remove the explicit ID.", + category: "Design", + DiagnosticSeverity.Warning, + isEnabledByDefault: true, + helpLinkUri: $"https://aka.ms/aspire/diagnostics/{RedundantExportIdId}"); + public static readonly ImmutableArray SupportedDiagnostics = ImmutableArray.Create( s_exportMethodMustBeStatic, s_invalidExportIdFormat, @@ -121,7 +131,8 @@ internal static class Diagnostics s_duplicateExportId, s_missingExportAttribute, s_exportNameShouldBeUnique, - s_exportedSyncDelegateInvokedInline + s_exportedSyncDelegateInvokedInline, + s_redundantExportId ); } } diff --git a/src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs b/src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs index cd857a02910..889eb4d1e50 100644 --- a/src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs +++ b/src/Aspire.Hosting.Integration.Analyzers/AspireExportAnalyzer.cs @@ -187,7 +187,8 @@ private static void AnalyzeMethod( // Rule 2: Validate export ID format var exportId = GetExportId(exportAttribute); - if (exportId is not null && !s_exportIdPattern.IsMatch(exportId)) + var isExportIdFormatValid = exportId is not null && s_exportIdPattern.IsMatch(exportId); + if (exportId is not null && !isExportIdFormatValid) { context.ReportDiagnostic(Diagnostic.Create( Diagnostics.s_invalidExportIdFormat, @@ -195,6 +196,27 @@ private static void AnalyzeMethod( exportId)); } + // Compute the effective export ID: either from the explicit attribute or auto-derived from method name (camelCase) + // Normalize empty/invalid exportId to null so the fallback applies + var derivedExportId = GetDerivedExportId(method, containingTypeExportAttribute); + var normalizedExportId = isExportIdFormatValid ? exportId : null; + var effectiveExportId = normalizedExportId ?? derivedExportId; + + // Rule 2b (ASPIREEXPORT011): Warn when explicit id matches the convention-derived name. + // Suppressed when Rule 7 (ASPIREEXPORT009) also fires — the two give contradictory advice + // (ASPIREEXPORT011 says "remove the id"; ASPIREEXPORT009 says "make the id more specific"), + // so only the actionable ASPIREEXPORT009 should appear. + if (isExportIdFormatValid && + string.Equals(exportId, derivedExportId, StringComparison.Ordinal) && + !HasConcreteResourceBuilderTargetParameter(method, wellKnownTypes)) + { + context.ReportDiagnostic(Diagnostic.Create( + Diagnostics.s_redundantExportId, + location, + exportId, + method.Name)); + } + // Rule 3: Validate return type is ATS-compatible if (!IsAtsCompatibleType(method.ReturnType, wellKnownTypes, aspireExportAttribute, currentAssemblyExportedTypes)) { @@ -226,19 +248,19 @@ private static void AnalyzeMethod( } // Rule 6 (ASPIREEXPORT007): Track export for duplicate detection - if (exportId is not null && method.IsExtensionMethod && method.Parameters.Length > 0) + if (effectiveExportId is not null && method.IsExtensionMethod && method.Parameters.Length > 0) { var targetType = method.Parameters[0].Type; var targetTypeName = targetType.ToDisplayString(); - var key = (exportId, targetTypeName); + var key = (effectiveExportId, targetTypeName); var bag = exportsByKey.GetOrAdd(key, _ => new ConcurrentBag<(IMethodSymbol, Location)>()); bag.Add((method, location)); } // Rule 7 (ASPIREEXPORT009): Warn when export name may collide across integrations - if (exportId is not null && method.IsExtensionMethod && method.Parameters.Length > 0) + if (effectiveExportId is not null && method.IsExtensionMethod && method.Parameters.Length > 0) { - AnalyzeExportNameUniqueness(context, method, exportId, wellKnownTypes, location); + AnalyzeExportNameUniqueness(context, method, effectiveExportId, wellKnownTypes, location); } } @@ -278,6 +300,35 @@ private static void AnalyzeMissingExportAttribute( reason ?? "Add [AspireExport] if ATS-compatible, or [AspireExportIgnore] with a reason.")); } + /// + /// Returns true when the method satisfies the ASPIREEXPORT009 preconditions (open-generic + /// IResourceBuilder<T> first parameter plus at least one concrete + /// IResourceBuilder<ConcreteType> parameter), independently of what the export ID is. + /// Used to suppress ASPIREEXPORT011 when ASPIREEXPORT009 would fire for the same method. + /// + private static bool HasConcreteResourceBuilderTargetParameter(IMethodSymbol method, WellKnownTypes wellKnownTypes) + { + if (!method.IsExtensionMethod || method.Parameters.Length < 2) + { + return false; + } + + if (!IsOpenGenericResourceBuilder(method.Parameters[0].Type, wellKnownTypes)) + { + return false; + } + + for (var i = 1; i < method.Parameters.Length; i++) + { + if (GetConcreteResourceBuilderTypeName(method.Parameters[i].Type, wellKnownTypes) is not null) + { + return true; + } + } + + return false; + } + private static void AnalyzeExportNameUniqueness( SymbolAnalysisContext context, IMethodSymbol method, @@ -807,6 +858,43 @@ private static void ReportDuplicateExports( return null; } + private static string? GetDerivedExportId(IMethodSymbol method, AttributeData? containingTypeExportAttribute) + { + if (string.IsNullOrEmpty(method.Name)) + { + return null; + } + + var camelCaseName = char.ToLowerInvariant(method.Name[0]) + method.Name.Substring(1); + + // Non-static methods auto-exposed via ExposeMethods=true use TypeName.methodName to avoid collisions + if (!method.IsStatic && IsExposeMethodsEnabled(containingTypeExportAttribute)) + { + return $"{method.ContainingType.Name}.{camelCaseName}"; + } + + return camelCaseName; + } + + private static bool IsExposeMethodsEnabled(AttributeData? exportAttribute) + { + if (exportAttribute is null) + { + return false; + } + + foreach (var namedArgument in exportAttribute.NamedArguments) + { + if (namedArgument.Key == "ExposeMethods" && + namedArgument.Value.Value is bool enabled) + { + return enabled; + } + } + + return false; + } + private static bool TryGetEffectiveAspireExportAttribute(IMethodSymbol method, INamedTypeSymbol aspireExportAttribute, out AttributeData? exportAttribute, out AttributeData? containingTypeExportAttribute) { foreach (var attr in method.GetAttributes()) diff --git a/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs b/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs index 1f44f998629..0cdbc556719 100644 --- a/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs +++ b/src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs @@ -113,7 +113,7 @@ import config from '%%ASPIRE_VITE_RELATIVE_CONFIG_PATH%%' /// builder.Build().Run(); /// /// - [AspireExport("addNodeApp", Description = "Adds a Node.js application resource")] + [AspireExport(Description = "Adds a Node.js application resource")] public static IResourceBuilder AddNodeApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string scriptPath) { ArgumentNullException.ThrowIfNull(builder); @@ -327,7 +327,7 @@ private static IResourceBuilder WithNodeDefaults(this IRes /// automatically when publishing. The method configures the resource with Node.js defaults and sets up npm /// integration. /// - [AspireExport("addJavaScriptApp", Description = "Adds a JavaScript application resource")] + [AspireExport(Description = "Adds a JavaScript application resource")] public static IResourceBuilder AddJavaScriptApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string runScriptName = "dev") { ArgumentNullException.ThrowIfNull(builder); @@ -505,7 +505,7 @@ private static IResourceBuilder CreateDefaultJavaScriptAppBuilder /// /// - [AspireExport("addViteApp", Description = "Adds a Vite application resource")] + [AspireExport(Description = "Adds a Vite application resource")] public static IResourceBuilder AddViteApp(this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string runScriptName = "dev") { ArgumentNullException.ThrowIfNull(builder); @@ -667,7 +667,7 @@ public static IResourceBuilder AddViteApp(this IDistributedAppl /// .WithViteConfig("./vite.production.config.js"); /// /// - [AspireExport("withViteConfig", Description = "Configures a custom Vite configuration file")] + [AspireExport(Description = "Configures a custom Vite configuration file")] public static IResourceBuilder WithViteConfig(this IResourceBuilder builder, string configPath) { ArgumentNullException.ThrowIfNull(builder); @@ -686,7 +686,7 @@ public static IResourceBuilder WithViteConfig(this IResourceBui /// The install command itself passed to npm to install dependencies. /// The command-line arguments passed to npm to install dependencies. /// A reference to the . - [AspireExport("withNpm", Description = "Configures npm as the package manager")] + [AspireExport(Description = "Configures npm as the package manager")] public static IResourceBuilder WithNpm(this IResourceBuilder resource, bool install = true, string? installCommand = null, string[]? installArgs = null) where TResource : JavaScriptAppResource { ArgumentNullException.ThrowIfNull(resource); @@ -730,7 +730,7 @@ public static IResourceBuilder WithNpm(this IResourceBuild /// builder.Build().Run(); /// /// - [AspireExport("withBun", Description = "Configures Bun as the package manager")] + [AspireExport(Description = "Configures Bun as the package manager")] public static IResourceBuilder WithBun(this IResourceBuilder resource, bool install = true, string[]? installArgs = null) where TResource : JavaScriptAppResource { ArgumentNullException.ThrowIfNull(resource); @@ -794,7 +794,7 @@ private static string GetDefaultNpmInstallCommand(IResourceBuilderWhen true (default), automatically installs packages before the application starts. When false, only sets the package manager annotation without creating an installer resource. /// The command-line arguments passed to "yarn install". /// A reference to the . - [AspireExport("withYarn", Description = "Configures yarn as the package manager")] + [AspireExport(Description = "Configures yarn as the package manager")] public static IResourceBuilder WithYarn(this IResourceBuilder resource, bool install = true, string[]? installArgs = null) where TResource : JavaScriptAppResource { ArgumentNullException.ThrowIfNull(resource); @@ -869,7 +869,7 @@ private static string[] GetDefaultYarnInstallArgs( /// When true (default), automatically installs packages before the application starts. When false, only sets the package manager annotation without creating an installer resource. /// The command-line arguments passed to "pnpm install". /// A reference to the . - [AspireExport("withPnpm", Description = "Configures pnpm as the package manager")] + [AspireExport(Description = "Configures pnpm as the package manager")] public static IResourceBuilder WithPnpm(this IResourceBuilder resource, bool install = true, string[]? installArgs = null) where TResource : JavaScriptAppResource { ArgumentNullException.ThrowIfNull(resource); @@ -918,7 +918,7 @@ private static string[] GetDefaultPnpmInstallArgs(IResourceBuilder - [AspireExport("withBuildScript", Description = "Specifies an npm script to run before starting the application")] + [AspireExport(Description = "Specifies an npm script to run before starting the application")] public static IResourceBuilder WithBuildScript(this IResourceBuilder resource, string scriptName, string[]? args = null) where TResource : JavaScriptAppResource { return resource.WithAnnotation(new JavaScriptBuildScriptAnnotation(scriptName, args)); @@ -937,7 +937,7 @@ public static IResourceBuilder WithBuildScript(this IResou /// Use this method to specify a custom script and its arguments that should be executed when the resource is executed /// in RunMode. /// - [AspireExport("withRunScript", Description = "Specifies an npm script to run during development")] + [AspireExport(Description = "Specifies an npm script to run during development")] public static IResourceBuilder WithRunScript(this IResourceBuilder resource, string scriptName, string[]? args = null) where TResource : JavaScriptAppResource { return resource.WithAnnotation(new JavaScriptRunScriptAnnotation(scriptName, args)); @@ -1028,7 +1028,7 @@ internal static IResourceBuilder WithVSCodeDebugging(this IResourceBuilder /// /// [Experimental("ASPIREEXTENSION001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] - [AspireExport("withBrowserDebugger", Description = "Configures a browser debugger for the JavaScript application")] + [AspireExport(Description = "Configures a browser debugger for the JavaScript application")] public static IResourceBuilder WithBrowserDebugger( this IResourceBuilder builder, string browser = "msedge") diff --git a/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs b/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs index 39547635980..e7586a67d73 100644 --- a/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs +++ b/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs @@ -29,7 +29,7 @@ public static class KafkaBuilderExtensions /// The name of the resource. This name will be used as the connection string name when referenced in a dependency /// The host port of Kafka broker. /// A reference to the . - [AspireExport("addKafka", Description = "Adds a Kafka container resource")] + [AspireExport(Description = "Adds a Kafka container resource")] public static IResourceBuilder AddKafka(this IDistributedApplicationBuilder builder, [ResourceName] string name, int? port = null) { ArgumentNullException.ThrowIfNull(builder); @@ -89,7 +89,7 @@ public static IResourceBuilder AddKafka(this IDistributedAp /// Configuration callback for KafkaUI container resource. /// The name of the container (Optional). /// A reference to the . - [AspireExport("withKafkaUI", Description = "Adds a Kafka UI container to manage the Kafka resource", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds a Kafka UI container to manage the Kafka resource", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithKafkaUI(this IResourceBuilder builder, Action>? configureContainer = null, string? containerName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -153,7 +153,7 @@ static void ConfigureKafkaUIContainer(EnvironmentCallbackContext context, Endpoi /// The resource builder for KafkaUI. /// The port to bind on the host. If is used random port will be assigned. /// The resource builder for KafkaUI. - [AspireExport("withHostPort", Description = "Sets the host port for the Kafka UI container")] + [AspireExport(Description = "Sets the host port for the Kafka UI container")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); @@ -171,7 +171,7 @@ public static IResourceBuilder WithHostPort(this IReso /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a data volume to the Kafka container")] + [AspireExport(Description = "Adds a data volume to the Kafka container")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -188,7 +188,7 @@ public static IResourceBuilder WithDataVolume(this IResourc /// The source directory on the host to mount into the container. /// A flag that indicates if this is a read-only mount. /// The . - [AspireExport("withDataBindMount", Description = "Adds a data bind mount to the Kafka container")] + [AspireExport(Description = "Adds a data bind mount to the Kafka container")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Keycloak/KeycloakResourceBuilderExtensions.cs b/src/Aspire.Hosting.Keycloak/KeycloakResourceBuilderExtensions.cs index a36b1b4af52..f0eee4ed67a 100644 --- a/src/Aspire.Hosting.Keycloak/KeycloakResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting.Keycloak/KeycloakResourceBuilderExtensions.cs @@ -48,7 +48,7 @@ public static class KeycloakResourceBuilderExtensions /// /// /// - [AspireExport("addKeycloak", Description = "Adds a Keycloak container resource")] + [AspireExport(Description = "Adds a Keycloak container resource")] public static IResourceBuilder AddKeycloak( this IDistributedApplicationBuilder builder, string name, @@ -147,7 +147,7 @@ public static IResourceBuilder AddKeycloak( /// /// /// - [AspireExport("withDataVolume", Description = "Adds a data volume for Keycloak")] + [AspireExport(Description = "Adds a data volume for Keycloak")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null) { ArgumentNullException.ThrowIfNull(builder); @@ -171,7 +171,7 @@ public static IResourceBuilder WithDataVolume(this IResourceBu /// /// /// - [AspireExport("withDataBindMount", Description = "Adds a data bind mount for Keycloak")] + [AspireExport(Description = "Adds a data bind mount for Keycloak")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source) { ArgumentNullException.ThrowIfNull(builder); @@ -249,7 +249,7 @@ public static IResourceBuilder WithRealmImport( /// The resource builder. /// Names of features to enable for the keycloak resource /// The . - [AspireExport("withEnabledFeatures", Description = "Enables Keycloak features")] + [AspireExport(Description = "Enables Keycloak features")] public static IResourceBuilder WithEnabledFeatures( this IResourceBuilder builder, params string[] features) @@ -270,7 +270,7 @@ public static IResourceBuilder WithEnabledFeatures( /// The resource builder. /// Names of features to disable for the keycloak resource /// The . - [AspireExport("withDisabledFeatures", Description = "Disables Keycloak features")] + [AspireExport(Description = "Disables Keycloak features")] public static IResourceBuilder WithDisabledFeatures( this IResourceBuilder builder, params string[] features) @@ -296,7 +296,7 @@ public static IResourceBuilder WithDisabledFeatures( /// /// The keycloak resource builder. /// The . - [AspireExport("withOtlpExporter", Description = "Configures the OTLP exporter for Keycloak")] + [AspireExport(Description = "Configures the OTLP exporter for Keycloak")] public static IResourceBuilder WithOtlpExporter(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Kubernetes/KubernetesEnvironmentExtensions.cs b/src/Aspire.Hosting.Kubernetes/KubernetesEnvironmentExtensions.cs index e910a1b53ac..89be7f224b6 100644 --- a/src/Aspire.Hosting.Kubernetes/KubernetesEnvironmentExtensions.cs +++ b/src/Aspire.Hosting.Kubernetes/KubernetesEnvironmentExtensions.cs @@ -26,7 +26,7 @@ internal static IDistributedApplicationBuilder AddKubernetesInfrastructureCore(t /// The . /// The name of the Kubernetes environment resource. /// A reference to the . - [AspireExport("addKubernetesEnvironment", Description = "Adds a Kubernetes publishing environment")] + [AspireExport(Description = "Adds a Kubernetes publishing environment")] public static IResourceBuilder AddKubernetesEnvironment( this IDistributedApplicationBuilder builder, [ResourceName] string name) @@ -57,7 +57,7 @@ public static IResourceBuilder AddKubernetesEnvir /// The Kubernetes environment resource builder. /// A method that can be used for customizing the . /// A reference to the . - [AspireExport("withProperties", Description = "Configures properties of a Kubernetes environment", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configures properties of a Kubernetes environment", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithProperties(this IResourceBuilder builder, Action configure) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Kubernetes/KubernetesServiceExtensions.cs b/src/Aspire.Hosting.Kubernetes/KubernetesServiceExtensions.cs index 0e2473e5064..a025f752484 100644 --- a/src/Aspire.Hosting.Kubernetes/KubernetesServiceExtensions.cs +++ b/src/Aspire.Hosting.Kubernetes/KubernetesServiceExtensions.cs @@ -30,7 +30,7 @@ public static class KubernetesServiceExtensions /// /// /// - [AspireExport("publishAsKubernetesService", Description = "Publishes the resource as a Kubernetes service")] + [AspireExport(Description = "Publishes the resource as a Kubernetes service")] public static IResourceBuilder PublishAsKubernetesService(this IResourceBuilder builder, Action configure) where T : IComputeResource { diff --git a/src/Aspire.Hosting.Maui/MauiAndroidExtensions.cs b/src/Aspire.Hosting.Maui/MauiAndroidExtensions.cs index 98e195610bb..b0f71d432b7 100644 --- a/src/Aspire.Hosting.Maui/MauiAndroidExtensions.cs +++ b/src/Aspire.Hosting.Maui/MauiAndroidExtensions.cs @@ -142,7 +142,7 @@ public static IResourceBuilder AddAndroidDevice( /// builder.Build().Run(); /// /// - [AspireExport("addAndroidDevice", Description = "Adds an Android device resource for a .NET MAUI project.")] + [AspireExport(Description = "Adds an Android device resource for a .NET MAUI project.")] public static IResourceBuilder AddAndroidDevice( this IResourceBuilder builder, [ResourceName] string name, @@ -336,7 +336,7 @@ public static IResourceBuilder AddAndroidEmulator( /// builder.Build().Run(); /// /// - [AspireExport("addAndroidEmulator", Description = "Adds an Android emulator resource for a .NET MAUI project.")] + [AspireExport(Description = "Adds an Android emulator resource for a .NET MAUI project.")] public static IResourceBuilder AddAndroidEmulator( this IResourceBuilder builder, [ResourceName] string name, diff --git a/src/Aspire.Hosting.Maui/MauiMacCatalystExtensions.cs b/src/Aspire.Hosting.Maui/MauiMacCatalystExtensions.cs index 09115ae8532..ec87250a486 100644 --- a/src/Aspire.Hosting.Maui/MauiMacCatalystExtensions.cs +++ b/src/Aspire.Hosting.Maui/MauiMacCatalystExtensions.cs @@ -74,7 +74,7 @@ public static IResourceBuilder AddMacCatalystDe /// builder.Build().Run(); /// /// - [AspireExport("addMacCatalystDevice", Description = "Adds a Mac Catalyst platform resource for a .NET MAUI project.")] + [AspireExport(Description = "Adds a Mac Catalyst platform resource for a .NET MAUI project.")] public static IResourceBuilder AddMacCatalystDevice( this IResourceBuilder builder, [ResourceName] string name) diff --git a/src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs b/src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs index b5b999379c7..f3b76e6e580 100644 --- a/src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs +++ b/src/Aspire.Hosting.Maui/MauiOtlpExtensions.cs @@ -49,7 +49,7 @@ public static class MauiOtlpExtensions /// builder.Build().Run(); /// /// - [AspireExport("withOtlpDevTunnel", Description = "Configures a .NET MAUI platform resource to send OpenTelemetry data through a development tunnel.")] + [AspireExport(Description = "Configures a .NET MAUI platform resource to send OpenTelemetry data through a development tunnel.")] public static IResourceBuilder WithOtlpDevTunnel( this IResourceBuilder builder) where T : IMauiPlatformResource, IResourceWithEnvironment diff --git a/src/Aspire.Hosting.Maui/MauiProjectResourceExtensions.cs b/src/Aspire.Hosting.Maui/MauiProjectResourceExtensions.cs index 0ceee29ba90..467fbf87f74 100644 --- a/src/Aspire.Hosting.Maui/MauiProjectResourceExtensions.cs +++ b/src/Aspire.Hosting.Maui/MauiProjectResourceExtensions.cs @@ -42,7 +42,7 @@ public static class MauiProjectExtensions /// builder.Build().Run(); /// /// - [AspireExport("addMauiProject", Description = "Adds a .NET MAUI project to the application model.")] + [AspireExport(Description = "Adds a .NET MAUI project to the application model.")] public static IResourceBuilder AddMauiProject( this IDistributedApplicationBuilder builder, [ResourceName] string name, diff --git a/src/Aspire.Hosting.Maui/MauiWindowsExtensions.cs b/src/Aspire.Hosting.Maui/MauiWindowsExtensions.cs index cfd2e89b010..e1a86855eae 100644 --- a/src/Aspire.Hosting.Maui/MauiWindowsExtensions.cs +++ b/src/Aspire.Hosting.Maui/MauiWindowsExtensions.cs @@ -74,7 +74,7 @@ public static IResourceBuilder AddWindowsDevice( /// builder.Build().Run(); /// /// - [AspireExport("addWindowsDevice", Description = "Adds a Windows platform resource for a .NET MAUI project.")] + [AspireExport(Description = "Adds a Windows platform resource for a .NET MAUI project.")] public static IResourceBuilder AddWindowsDevice( this IResourceBuilder builder, [ResourceName] string name) diff --git a/src/Aspire.Hosting.Maui/MauiiOSExtensions.cs b/src/Aspire.Hosting.Maui/MauiiOSExtensions.cs index c0f0d9ffa0b..35a8b19b716 100644 --- a/src/Aspire.Hosting.Maui/MauiiOSExtensions.cs +++ b/src/Aspire.Hosting.Maui/MauiiOSExtensions.cs @@ -149,7 +149,7 @@ public static IResourceBuilder AddiOSDevice( /// builder.Build().Run(); /// /// - [AspireExport("addiOSDevice", Description = "Adds an iOS device resource for a .NET MAUI project.")] + [AspireExport(Description = "Adds an iOS device resource for a .NET MAUI project.")] public static IResourceBuilder AddiOSDevice( this IResourceBuilder builder, [ResourceName] string name, @@ -344,7 +344,7 @@ public static IResourceBuilder AddiOSSimulator( /// builder.Build().Run(); /// /// - [AspireExport("addiOSSimulator", Description = "Adds an iOS simulator resource for a .NET MAUI project.")] + [AspireExport(Description = "Adds an iOS simulator resource for a .NET MAUI project.")] public static IResourceBuilder AddiOSSimulator( this IResourceBuilder builder, [ResourceName] string name, diff --git a/src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs b/src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs index 6b27170253e..a327a742dcc 100644 --- a/src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs +++ b/src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs @@ -38,7 +38,7 @@ public static class MilvusBuilderExtensions /// The parameter used to provide the auth key/token user for the Milvus resource. /// The host port of gRPC endpoint of Milvus database. /// A reference to the . - [AspireExport("addMilvus", Description = "Adds a Milvus server resource to the distributed application model.")] + [AspireExport(Description = "Adds a Milvus server resource to the distributed application model.")] public static IResourceBuilder AddMilvus(this IDistributedApplicationBuilder builder, string name, IResourceBuilder? apiKey = null, @@ -93,7 +93,7 @@ public static IResourceBuilder AddMilvus(this IDistributed /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// The name of the database. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addDatabase", Description = "Adds a Milvus database resource to a Milvus server resource.")] + [AspireExport(Description = "Adds a Milvus database resource to a Milvus server resource.")] public static IResourceBuilder AddDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -130,7 +130,7 @@ public static IResourceBuilder AddDatabase(this IResourc /// Configuration callback for Attu container resource. /// The name of the container (Optional). /// A reference to the . - [AspireExport("withAttu", Description = "Adds the Attu administration tool for Milvus.", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds the Attu administration tool for Milvus.", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithAttu(this IResourceBuilder builder, Action>? configureContainer = null, string? containerName = null) where T : MilvusServerResource { ArgumentNullException.ThrowIfNull(builder); @@ -157,7 +157,7 @@ public static IResourceBuilder WithAttu(this IResourceBuilder builder, /// The name of the volume. Defaults to an auto-generated name based on the resource name. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a persistent data volume to the Milvus server resource.")] + [AspireExport(Description = "Adds a persistent data volume to the Milvus server resource.")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -172,7 +172,7 @@ public static IResourceBuilder WithDataVolume(this IResour /// The source directory on the host to mount into the container. /// A flag that indicates if this is a read-only mount. /// The . - [AspireExport("withDataBindMount", Description = "Mounts a host directory as the Milvus data directory.")] + [AspireExport(Description = "Mounts a host directory as the Milvus data directory.")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -202,7 +202,7 @@ public static IResourceBuilder WithConfigurationBindMount( /// The resource builder. /// The configuration file on the host to copy into the container. /// The . - [AspireExport("withConfigurationFile", Description = "Copies a Milvus configuration file into the container.")] + [AspireExport(Description = "Copies a Milvus configuration file into the container.")] public static IResourceBuilder WithConfigurationFile(this IResourceBuilder builder, string configurationFilePath) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs b/src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs index 0c083f0f0f5..39c68ce8489 100644 --- a/src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs +++ b/src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs @@ -46,7 +46,7 @@ public static IResourceBuilder AddMongoDB(this IDistribut /// A parameter that contains the MongoDb server user name, or to use a default value. /// A parameter that contains the MongoDb server password, or to use a generated password. /// A reference to the . - [AspireExport("addMongoDB", Description = "Adds a MongoDB container resource")] + [AspireExport(Description = "Adds a MongoDB container resource")] public static IResourceBuilder AddMongoDB(this IDistributedApplicationBuilder builder, string name, int? port = null, @@ -100,7 +100,7 @@ public static IResourceBuilder AddMongoDB(this IDistribut /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// The name of the database. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addDatabase", Description = "Adds a MongoDB database resource")] + [AspireExport(Description = "Adds a MongoDB database resource")] public static IResourceBuilder AddDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -149,7 +149,7 @@ public static IResourceBuilder AddDatabase(this IResour /// Configuration callback for Mongo Express container resource. /// The name of the container (Optional). /// A reference to the . - [AspireExport("withMongoExpress", Description = "Adds a MongoExpress administration platform for MongoDB", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds a MongoExpress administration platform for MongoDB", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithMongoExpress(this IResourceBuilder builder, Action>? configureContainer = null, string? containerName = null) where T : MongoDBServerResource { @@ -177,7 +177,7 @@ public static IResourceBuilder WithMongoExpress(this IResourceBuilder b /// The resource builder for Mongo Express. /// The port to bind on the host. If is used random port will be assigned. /// A reference to the . - [AspireExport("withHostPort", Description = "Sets the host port for the Mongo Express resource")] + [AspireExport(Description = "Sets the host port for the Mongo Express resource")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); @@ -195,7 +195,7 @@ public static IResourceBuilder WithHostPort(this /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a named volume for the MongoDB data folder")] + [AspireExport(Description = "Adds a named volume for the MongoDB data folder")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -210,7 +210,7 @@ public static IResourceBuilder WithDataVolume(this IResou /// The source directory on the host to mount into the container. /// A flag that indicates if this is a read-only mount. /// The . - [AspireExport("withDataBindMount", Description = "Adds a bind mount for the MongoDB data folder")] + [AspireExport(Description = "Adds a bind mount for the MongoDB data folder")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -243,7 +243,7 @@ public static IResourceBuilder WithInitBindMount(this IRe /// The resource builder. /// The source file or directory on the host to copy into the container. /// The . - [AspireExport("withInitFiles", Description = "Copies init files into a MongoDB container")] + [AspireExport(Description = "Copies init files into a MongoDB container")] public static IResourceBuilder WithInitFiles(this IResourceBuilder builder, string source) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs b/src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs index 6d6f4bac96e..7a88d7abc2c 100644 --- a/src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs +++ b/src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs @@ -31,7 +31,7 @@ public static class MySqlBuilderExtensions /// The parameter used to provide the root password for the MySQL resource. If a random password will be generated. /// The host port for MySQL. /// A reference to the . - [AspireExport("addMySql", Description = "Adds a MySQL server resource")] + [AspireExport(Description = "Adds a MySQL server resource")] public static IResourceBuilder AddMySql(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder? password = null, int? port = null) { ArgumentNullException.ThrowIfNull(builder); @@ -109,7 +109,7 @@ public static IResourceBuilder AddMySql(this IDistributedAp /// The database creation happens automatically as part of the resource lifecycle. /// /// - [AspireExport("addDatabase", Description = "Adds a MySQL database")] + [AspireExport(Description = "Adds a MySQL database")] public static IResourceBuilder AddDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -183,7 +183,7 @@ private static async Task CreateDatabaseAsync(MySqlConnection sqlConnection, MyS /// /// Default script is CREATE DATABASE IF NOT EXISTS `QUOTED_DATABASE_NAME`; /// - [AspireExport("withCreationScript", Description = "Defines the SQL script for database creation")] + [AspireExport(Description = "Defines the SQL script for database creation")] public static IResourceBuilder WithCreationScript(this IResourceBuilder builder, string script) { ArgumentNullException.ThrowIfNull(builder); @@ -200,7 +200,7 @@ public static IResourceBuilder WithCreationScript(this IR /// The resource builder. /// The parameter used to provide the password for the MySQL resource. /// The . - [AspireExport("withPassword", Description = "Configures the MySQL password")] + [AspireExport(Description = "Configures the MySQL password")] public static IResourceBuilder WithPassword(this IResourceBuilder builder, IResourceBuilder password) { ArgumentNullException.ThrowIfNull(builder); @@ -220,7 +220,7 @@ public static IResourceBuilder WithPassword(this IResourceB /// Callback to configure PhpMyAdmin container resource. /// The name of the container (Optional). /// A reference to the . - [AspireExport("withPhpMyAdmin", Description = "Adds phpMyAdmin management UI", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds phpMyAdmin management UI", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithPhpMyAdmin(this IResourceBuilder builder, Action>? configureContainer = null, string? containerName = null) where T : MySqlServerResource { ArgumentNullException.ThrowIfNull(builder); @@ -309,7 +309,7 @@ public static IResourceBuilder WithPhpMyAdmin(this IResourceBuilder bui /// The resource builder for PGAdmin. /// The port to bind on the host. If is used, a random port will be assigned. /// The resource builder for PGAdmin. - [AspireExport("withHostPort", Description = "Sets the host port for phpMyAdmin")] + [AspireExport(Description = "Sets the host port for phpMyAdmin")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); @@ -327,7 +327,7 @@ public static IResourceBuilder WithHostPort(this IR /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a data volume for MySQL")] + [AspireExport(Description = "Adds a data volume for MySQL")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -342,7 +342,7 @@ public static IResourceBuilder WithDataVolume(this IResourc /// The source directory on the host to mount into the container. /// A flag that indicates if this is a read-only mount. /// The . - [AspireExport("withDataBindMount", Description = "Adds a data bind mount for MySQL")] + [AspireExport(Description = "Adds a data bind mount for MySQL")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -373,7 +373,7 @@ public static IResourceBuilder WithInitBindMount(this IReso /// The resource builder. /// The source file or directory on the host to copy into the container. /// The . - [AspireExport("withInitFiles", Description = "Copies init files to MySQL")] + [AspireExport(Description = "Copies init files to MySQL")] public static IResourceBuilder WithInitFiles(this IResourceBuilder builder, string source) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Nats/NatsBuilderExtensions.cs b/src/Aspire.Hosting.Nats/NatsBuilderExtensions.cs index 30cb5d640ff..65624e300f1 100644 --- a/src/Aspire.Hosting.Nats/NatsBuilderExtensions.cs +++ b/src/Aspire.Hosting.Nats/NatsBuilderExtensions.cs @@ -143,7 +143,7 @@ public static IResourceBuilder WithJetStream(this IResourceB /// /// The resource builder. /// The . - [AspireExport("withJetStream", Description = "Configures the NATS resource to enable JetStream.")] + [AspireExport(Description = "Configures the NATS resource to enable JetStream.")] public static IResourceBuilder WithJetStream(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder); @@ -158,7 +158,7 @@ public static IResourceBuilder WithJetStream(this IResourceB /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a persistent data volume to the NATS resource.")] + [AspireExport(Description = "Adds a persistent data volume to the NATS resource.")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -175,7 +175,7 @@ public static IResourceBuilder WithDataVolume(this IResource /// The source directory on the host to mount into the container. /// A flag that indicates if this is a read-only mount. /// The . - [AspireExport("withDataBindMount", Description = "Mounts a host directory as the NATS data directory.")] + [AspireExport(Description = "Mounts a host directory as the NATS data directory.")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.OpenAI/OpenAIExtensions.cs b/src/Aspire.Hosting.OpenAI/OpenAIExtensions.cs index a659af67241..4878e9e41bb 100644 --- a/src/Aspire.Hosting.OpenAI/OpenAIExtensions.cs +++ b/src/Aspire.Hosting.OpenAI/OpenAIExtensions.cs @@ -19,7 +19,7 @@ public static class OpenAIExtensions /// The . /// The name of the OpenAI resource. /// The OpenAI resource builder. - [AspireExport("addOpenAI", Description = "Adds an OpenAI resource to the distributed application model.")] + [AspireExport(Description = "Adds an OpenAI resource to the distributed application model.")] public static IResourceBuilder AddOpenAI(this IDistributedApplicationBuilder builder, [ResourceName] string name) { ArgumentNullException.ThrowIfNull(builder); @@ -100,7 +100,7 @@ await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Servic /// The name of the model resource. This name is used as the connection string name. /// The model identifier, e.g., "gpt-4o-mini". /// The model resource builder. - [AspireExport("addModel", Description = "Adds an OpenAI model resource.")] + [AspireExport(Description = "Adds an OpenAI model resource.")] public static IResourceBuilder AddModel(this IResourceBuilder builder, [ResourceName] string name, string model) { ArgumentNullException.ThrowIfNull(builder); @@ -141,7 +141,7 @@ await evt.Eventing.PublishAsync(new ConnectionStringAvailableEvent(r, evt.Servic /// /// The OpenAI parent resource builder. /// The endpoint URI, e.g., https://mygateway.example.com/v1. - [AspireExport("withEndpoint", Description = "Configures the endpoint URI for the OpenAI resource.")] + [AspireExport(Description = "Configures the endpoint URI for the OpenAI resource.")] public static IResourceBuilder WithEndpoint(this IResourceBuilder builder, string endpoint) { ArgumentNullException.ThrowIfNull(builder); @@ -154,7 +154,7 @@ public static IResourceBuilder WithEndpoint(this IResourceBuilde /// /// Configures the API key for the OpenAI parent resource from a parameter. /// - [AspireExport("withApiKey", Description = "Configures the API key for the OpenAI resource.")] + [AspireExport(Description = "Configures the API key for the OpenAI resource.")] public static IResourceBuilder WithApiKey(this IResourceBuilder builder, IResourceBuilder apiKey) { ArgumentNullException.ThrowIfNull(builder); @@ -197,7 +197,7 @@ public static IResourceBuilder WithApiKey(this IResourceBuilder< /// the model is not working as expected. Furthermore, the health check will run a single time per application instance. /// /// - [AspireExport("withHealthCheck", Description = "Adds a health check for the OpenAI model resource.")] + [AspireExport(Description = "Adds a health check for the OpenAI model resource.")] public static IResourceBuilder WithHealthCheck(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Oracle/OracleDatabaseBuilderExtensions.cs b/src/Aspire.Hosting.Oracle/OracleDatabaseBuilderExtensions.cs index 8bc678a04bd..6763d0ef999 100644 --- a/src/Aspire.Hosting.Oracle/OracleDatabaseBuilderExtensions.cs +++ b/src/Aspire.Hosting.Oracle/OracleDatabaseBuilderExtensions.cs @@ -25,7 +25,7 @@ public static class OracleDatabaseBuilderExtensions /// The parameter used to provide the administrator password for the Oracle Server resource. If a random password will be generated. /// The host port for Oracle Server. /// A reference to the . - [AspireExport("addOracle", Description = "Adds an Oracle server resource to the distributed application model.")] + [AspireExport(Description = "Adds an Oracle server resource to the distributed application model.")] public static IResourceBuilder AddOracle( this IDistributedApplicationBuilder builder, [ResourceName] string name, @@ -74,7 +74,7 @@ public static IResourceBuilder AddOracle( /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// The name of the database. If not provided, this defaults to the same value as . /// A reference to the . - [AspireExport("addDatabase", Description = "Adds an Oracle database resource to an Oracle server resource.")] + [AspireExport(Description = "Adds an Oracle database resource to an Oracle server resource.")] public static IResourceBuilder AddDatabase( this IResourceBuilder builder, [ResourceName] string name, @@ -97,7 +97,7 @@ public static IResourceBuilder AddDatabase( /// The resource builder. /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// The . - [AspireExport("withDataVolume", Description = "Adds a persistent data volume to the Oracle server resource.")] + [AspireExport(Description = "Adds a persistent data volume to the Oracle server resource.")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null) { ArgumentNullException.ThrowIfNull(builder); @@ -111,7 +111,7 @@ public static IResourceBuilder WithDataVolume(this /// The resource builder. /// The source directory on the host to mount into the container. /// The . - [AspireExport("withDataBindMount", Description = "Mounts a host directory as the Oracle data directory.")] + [AspireExport(Description = "Mounts a host directory as the Oracle data directory.")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source) { ArgumentNullException.ThrowIfNull(builder); @@ -141,7 +141,7 @@ public static IResourceBuilder WithInitBindMount(t /// The resource builder. /// The source file or directory on the host to copy into the container. /// The . - [AspireExport("withInitFiles", Description = "Copies initialization files into the Oracle container.")] + [AspireExport(Description = "Copies initialization files into the Oracle container.")] public static IResourceBuilder WithInitFiles(this IResourceBuilder builder, string source) { ArgumentNullException.ThrowIfNull(builder); @@ -160,7 +160,7 @@ public static IResourceBuilder WithInitFiles(this /// The resource builder. /// The source directory on the host to mount into the container. /// The . - [AspireExport("withDbSetupBindMount", Description = "Mounts a host directory as the Oracle DB setup directory.")] + [AspireExport(Description = "Mounts a host directory as the Oracle DB setup directory.")] public static IResourceBuilder WithDbSetupBindMount(this IResourceBuilder builder, string source) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Orleans/OrleansServiceExtensions.cs b/src/Aspire.Hosting.Orleans/OrleansServiceExtensions.cs index f981152e4e4..01b15229c33 100644 --- a/src/Aspire.Hosting.Orleans/OrleansServiceExtensions.cs +++ b/src/Aspire.Hosting.Orleans/OrleansServiceExtensions.cs @@ -23,7 +23,7 @@ public static class OrleansServiceExtensions /// The application builder. /// The name of the Orleans service. /// The Orleans service builder. - [AspireExport("addOrleans", Description = "Adds an Orleans service configuration")] + [AspireExport(Description = "Adds an Orleans service configuration")] public static OrleansService AddOrleans( this IDistributedApplicationBuilder builder, string name) @@ -35,7 +35,7 @@ public static OrleansService AddOrleans( /// The target Orleans service builder. /// The ClusterId value. /// The Orleans service builder. - [AspireExport("withClusterId", Description = "Sets the Orleans cluster ID")] + [AspireExport(Description = "Sets the Orleans cluster ID")] public static OrleansService WithClusterId( this OrleansService orleansServiceBuilder, string clusterId) @@ -66,7 +66,7 @@ public static OrleansService WithClusterId( /// The target Orleans service builder. /// The ServiceId value. /// The Orleans service builder. - [AspireExport("withServiceId", Description = "Sets the Orleans service ID")] + [AspireExport(Description = "Sets the Orleans service ID")] public static OrleansService WithServiceId( this OrleansService orleansServiceBuilder, string serviceId) @@ -97,7 +97,7 @@ public static OrleansService WithServiceId( /// The target Orleans service builder. /// The provider. /// The Orleans service builder. - [AspireExport("withClustering", Description = "Configures Orleans clustering using a resource connection")] + [AspireExport(Description = "Configures Orleans clustering using a resource connection")] public static OrleansService WithClustering( this OrleansService orleansServiceBuilder, IResourceBuilder provider) @@ -124,7 +124,7 @@ public static OrleansService WithClustering( /// /// The target Orleans service builder. /// The Orleans service builder. - [AspireExport("withDevelopmentClustering", Description = "Configures Orleans development clustering")] + [AspireExport(Description = "Configures Orleans development clustering")] public static OrleansService WithDevelopmentClustering( this OrleansService orleansServiceBuilder) => WithClustering(orleansServiceBuilder, s_developmentClustering); @@ -149,7 +149,7 @@ public static OrleansService WithGrainStorage( /// The name of the provider. This is the name the application will use to resolve the provider. /// The provider to add. /// The Orleans service builder. - [AspireExport("withGrainStorage", Description = "Adds an Orleans grain storage provider")] + [AspireExport(Description = "Adds an Orleans grain storage provider")] public static OrleansService WithGrainStorage( this OrleansService orleansServiceBuilder, string name, @@ -180,7 +180,7 @@ public static OrleansService WithGrainStorage( /// The target Orleans service builder. /// The name of the provider. This is the name the application will use to resolve the provider. /// The Orleans service builder. - [AspireExport("withMemoryGrainStorage", Description = "Adds in-memory Orleans grain storage")] + [AspireExport(Description = "Adds in-memory Orleans grain storage")] public static OrleansService WithMemoryGrainStorage( this OrleansService orleansServiceBuilder, string name) @@ -206,7 +206,7 @@ public static OrleansService WithStreaming( /// The name of the provider. This is the name the application will use to resolve the provider. /// The provider to add. /// The Orleans service builder. - [AspireExport("withStreaming", Description = "Adds an Orleans stream provider")] + [AspireExport(Description = "Adds an Orleans stream provider")] public static OrleansService WithStreaming( this OrleansService orleansServiceBuilder, string name, @@ -237,7 +237,7 @@ public static OrleansService WithStreaming( /// The target Orleans service builder. /// The name of the provider. This is the name the application will use to resolve the provider. /// The Orleans service builder. - [AspireExport("withMemoryStreaming", Description = "Adds in-memory Orleans streaming")] + [AspireExport(Description = "Adds in-memory Orleans streaming")] public static OrleansService WithMemoryStreaming( this OrleansService orleansServiceBuilder, string name) @@ -267,7 +267,7 @@ public static OrleansService WithBroadcastChannel( /// The target Orleans service builder. /// The name of the provider. This is the name the application will use to resolve the provider. /// The Orleans service builder. - [AspireExport("withBroadcastChannel", Description = "Adds an Orleans broadcast channel provider")] + [AspireExport(Description = "Adds an Orleans broadcast channel provider")] public static OrleansService WithBroadcastChannel( this OrleansService orleansServiceBuilder, string name) @@ -279,7 +279,7 @@ public static OrleansService WithBroadcastChannel( /// The target Orleans service builder. /// The reminder storage provider. /// The Orleans service builder. - [AspireExport("withReminders", Description = "Configures Orleans reminder storage")] + [AspireExport(Description = "Configures Orleans reminder storage")] public static OrleansService WithReminders( this OrleansService orleansServiceBuilder, IResourceBuilder provider) @@ -306,7 +306,7 @@ public static OrleansService WithReminders( /// /// The target Orleans service builder. /// The Orleans service builder. - [AspireExport("withMemoryReminders", Description = "Configures in-memory Orleans reminders")] + [AspireExport(Description = "Configures in-memory Orleans reminders")] public static OrleansService WithMemoryReminders( this OrleansService orleansServiceBuilder) { @@ -334,7 +334,7 @@ public static OrleansService WithGrainDirectory( /// The name of the provider. This is the name the application will use to resolve the provider. /// The provider to add. /// The Orleans service builder. - [AspireExport("withGrainDirectory", Description = "Adds an Orleans grain directory provider")] + [AspireExport(Description = "Adds an Orleans grain directory provider")] public static OrleansService WithGrainDirectory( this OrleansService orleansServiceBuilder, string name, @@ -364,7 +364,7 @@ public static OrleansService WithGrainDirectory( /// /// The Orleans service /// A model of the clients of an Orleans service. - [AspireExport("asClient", Description = "Creates an Orleans client view for the service")] + [AspireExport(Description = "Creates an Orleans client view for the service")] public static OrleansServiceClient AsClient(this OrleansService orleansService) { return new OrleansServiceClient(orleansService); diff --git a/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs b/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs index 66108289631..021351ba2c8 100644 --- a/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs +++ b/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs @@ -42,7 +42,7 @@ public static class PostgresBuilderExtensions /// /// This version of the package defaults to the tag of the container image. /// - [AspireExport("addPostgres", Description = "Adds a PostgreSQL server resource")] + [AspireExport(Description = "Adds a PostgreSQL server resource")] public static IResourceBuilder AddPostgres(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder? userName = null, @@ -140,7 +140,7 @@ public static IResourceBuilder AddPostgres(this IDistrib /// The database creation happens automatically as part of the resource lifecycle. /// /// - [AspireExport("addDatabase", Description = "Adds a PostgreSQL database")] + [AspireExport(Description = "Adds a PostgreSQL database")] public static IResourceBuilder AddDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -183,7 +183,7 @@ public static IResourceBuilder AddDatabase(this IResou /// Callback to configure PgAdmin container resource. /// The name of the container (Optional). /// A reference to the . - [AspireExport("withPgAdmin", Description = "Adds pgAdmin 4 management UI", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds pgAdmin 4 management UI", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithPgAdmin(this IResourceBuilder builder, Action>? configureContainer = null, string? containerName = null) where T : PostgresServerResource { @@ -293,7 +293,7 @@ public static IResourceBuilder WithHostPort(this IResour /// /// /// A reference to the . - [AspireExport("withPgWeb", Description = "Adds pgweb management UI", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds pgweb management UI", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithPgWeb(this IResourceBuilder builder, Action>? configureContainer = null, string? containerName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -361,7 +361,7 @@ public static IResourceBuilder WithPgWeb(this IResourceB /// This version of the package defaults to the tag of the container image. /// /// A reference to the . - [AspireExport("withPostgresMcp", Description = "Adds Postgres MCP server", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds Postgres MCP server", RunSyncOnBackgroundThread = true)] [Experimental("ASPIREPOSTGRES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder WithPostgresMcp( this IResourceBuilder builder, @@ -441,7 +441,7 @@ private static void SetPgAdminEnvironmentVariables(EnvironmentCallbackContext co /// This method automatically selects the correct path based on the configured container image tag. /// /// - [AspireExport("withDataVolume", Description = "Adds a data volume for PostgreSQL")] + [AspireExport(Description = "Adds a data volume for PostgreSQL")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -471,7 +471,7 @@ public static IResourceBuilder WithDataVolume(this IReso /// This method automatically selects the correct path based on the configured container image tag. /// /// - [AspireExport("withDataBindMount", Description = "Adds a data bind mount for PostgreSQL")] + [AspireExport(Description = "Adds a data bind mount for PostgreSQL")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -506,7 +506,7 @@ public static IResourceBuilder WithInitBindMount(this IR /// The resource builder. /// The source directory or files on the host to copy into the container. /// The . - [AspireExport("withInitFiles", Description = "Copies init files to PostgreSQL")] + [AspireExport(Description = "Copies init files to PostgreSQL")] public static IResourceBuilder WithInitFiles(this IResourceBuilder builder, string source) { ArgumentNullException.ThrowIfNull(builder); @@ -530,7 +530,7 @@ public static IResourceBuilder WithInitFiles(this IResou /// and data insertion are not supported since they require a distinct connection to the newly created database. /// Default script is CREATE DATABASE "<QUOTED_DATABASE_NAME>" /// - [AspireExport("withCreationScript", Description = "Defines the SQL script for database creation")] + [AspireExport(Description = "Defines the SQL script for database creation")] public static IResourceBuilder WithCreationScript(this IResourceBuilder builder, string script) { ArgumentNullException.ThrowIfNull(builder); @@ -547,7 +547,7 @@ public static IResourceBuilder WithCreationScript(this /// The resource builder. /// The parameter used to provide the password for the PostgreSQL resource. /// The . - [AspireExport("withPassword", Description = "Configures the PostgreSQL password")] + [AspireExport(Description = "Configures the PostgreSQL password")] public static IResourceBuilder WithPassword(this IResourceBuilder builder, IResourceBuilder password) { ArgumentNullException.ThrowIfNull(builder); @@ -563,7 +563,7 @@ public static IResourceBuilder WithPassword(this IResour /// The resource builder. /// The parameter used to provide the user name for the PostgreSQL resource. /// The . - [AspireExport("withUserName", Description = "Configures the PostgreSQL user name")] + [AspireExport(Description = "Configures the PostgreSQL user name")] public static IResourceBuilder WithUserName(this IResourceBuilder builder, IResourceBuilder userName) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs b/src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs index ccfd298b569..01a436a5311 100644 --- a/src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting.Python/PythonAppResourceBuilderExtensions.cs @@ -62,7 +62,7 @@ public static class PythonAppResourceBuilderExtensions /// /// [OverloadResolutionPriority(1)] - [AspireExport("addPythonApp", Description = "Adds a Python script application resource")] + [AspireExport(Description = "Adds a Python script application resource")] public static IResourceBuilder AddPythonApp( this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string scriptPath) => AddPythonAppCore(builder, name, appDirectory, EntrypointType.Script, scriptPath, DefaultVirtualEnvFolder) @@ -98,7 +98,7 @@ public static IResourceBuilder AddPythonApp( /// builder.Build().Run(); /// /// - [AspireExport("addPythonModule", Description = "Adds a Python module application resource")] + [AspireExport(Description = "Adds a Python module application resource")] public static IResourceBuilder AddPythonModule( this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string moduleName) => AddPythonAppCore(builder, name, appDirectory, EntrypointType.Module, moduleName, DefaultVirtualEnvFolder) @@ -137,7 +137,7 @@ public static IResourceBuilder AddPythonModule( /// builder.Build().Run(); /// /// - [AspireExport("addPythonExecutable", Description = "Adds a Python executable application resource")] + [AspireExport(Description = "Adds a Python executable application resource")] public static IResourceBuilder AddPythonExecutable( this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string executableName) => AddPythonAppCore(builder, name, appDirectory, EntrypointType.Executable, executableName, DefaultVirtualEnvFolder); @@ -260,7 +260,7 @@ public static IResourceBuilder AddPythonApp( /// builder.Build().Run(); /// /// - [AspireExport("addUvicornApp", Description = "Adds a Uvicorn-based Python application resource")] + [AspireExport(Description = "Adds a Uvicorn-based Python application resource")] public static IResourceBuilder AddUvicornApp( this IDistributedApplicationBuilder builder, [ResourceName] string name, string appDirectory, string app) { @@ -852,7 +852,7 @@ private static string ResolveDefaultVirtualEnvironmentPath(IDistributedApplicati /// .WithVirtualEnvironment("myenv", createIfNotExists: false); /// /// - [AspireExport("withVirtualEnvironment", Description = "Configures the virtual environment for a Python application")] + [AspireExport(Description = "Configures the virtual environment for a Python application")] public static IResourceBuilder WithVirtualEnvironment( this IResourceBuilder builder, string virtualEnvironmentPath, bool createIfNotExists = true) where T : PythonAppResource { @@ -912,7 +912,7 @@ public static IResourceBuilder WithVirtualEnvironment( /// the program or module to debug, and appropriate launch settings. /// /// - [AspireExport("withDebugging", Description = "Enables debugging support for a Python application")] + [AspireExport(Description = "Enables debugging support for a Python application")] public static IResourceBuilder WithDebugging( this IResourceBuilder builder) where T : PythonAppResource { @@ -1041,7 +1041,7 @@ public static IResourceBuilder WithDebugging( /// .WithArgs("main:app", "--reload"); /// /// - [AspireExport("withEntrypoint", Description = "Configures the entrypoint for a Python application")] + [AspireExport(Description = "Configures the entrypoint for a Python application")] public static IResourceBuilder WithEntrypoint( this IResourceBuilder builder, EntrypointType entrypointType, string entrypoint) where T : PythonAppResource { @@ -1138,7 +1138,7 @@ public static IResourceBuilder WithEntrypoint( /// /// /// Thrown when is null. - [AspireExport("withPip", Description = "Configures pip package installation for a Python application")] + [AspireExport(Description = "Configures pip package installation for a Python application")] public static IResourceBuilder WithPip(this IResourceBuilder builder, bool install = true, string[]? installArgs = null) where T : PythonAppResource { @@ -1235,7 +1235,7 @@ public static IResourceBuilder WithPip(this IResourceBuilder builder, b /// /// /// Thrown when is null. - [AspireExport("withUv", Description = "Configures uv package management for a Python application")] + [AspireExport(Description = "Configures uv package management for a Python application")] public static IResourceBuilder WithUv(this IResourceBuilder builder, bool install = true, string[]? args = null) where T : PythonAppResource { diff --git a/src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs b/src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs index 986748cb603..8a3eb07dcb8 100644 --- a/src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs +++ b/src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs @@ -34,7 +34,7 @@ public static class QdrantBuilderExtensions /// The host port of gRPC endpoint of Qdrant database. /// The host port of HTTP endpoint of Qdrant database. /// A reference to the . - [AspireExport("addQdrant", Description = "Adds a Qdrant resource to the application. A container is used for local development.")] + [AspireExport(Description = "Adds a Qdrant resource to the application. A container is used for local development.")] public static IResourceBuilder AddQdrant(this IDistributedApplicationBuilder builder, string name, IResourceBuilder? apiKey = null, @@ -105,7 +105,7 @@ public static IResourceBuilder AddQdrant(this IDistributed /// The name of the volume. Defaults to an auto-generated name based on the resource name. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a named volume for the data folder to a Qdrant container resource.")] + [AspireExport(Description = "Adds a named volume for the data folder to a Qdrant container resource.")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -121,7 +121,7 @@ public static IResourceBuilder WithDataVolume(this IResour /// The source directory on the host to mount into the container. /// A flag that indicates if this is a read-only mount. /// The . - [AspireExport("withDataBindMount", Description = "Adds a bind mount for the data folder to a Qdrant container resource.")] + [AspireExport(Description = "Adds a bind mount for the data folder to a Qdrant container resource.")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs b/src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs index 92bfa231531..b56677a5840 100644 --- a/src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs +++ b/src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs @@ -26,7 +26,7 @@ public static class RabbitMQBuilderExtensions /// The parameter used to provide the password for the RabbitMQ resource. If a random password will be generated. /// The host port that the underlying container is bound to when running locally. /// A reference to the . - [AspireExport("addRabbitMQ", Description = "Adds a RabbitMQ container resource")] + [AspireExport(Description = "Adds a RabbitMQ container resource")] public static IResourceBuilder AddRabbitMQ(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder? userName = null, @@ -93,7 +93,7 @@ static Task CreateConnection(string connectionString) /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a data volume to the RabbitMQ container")] + [AspireExport(Description = "Adds a data volume to the RabbitMQ container")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -109,7 +109,7 @@ public static IResourceBuilder WithDataVolume(this IReso /// The source directory on the host to mount into the container. /// A flag that indicates if this is a read-only mount. /// The . - [AspireExport("withDataBindMount", Description = "Adds a data bind mount to the RabbitMQ container")] + [AspireExport(Description = "Adds a data bind mount to the RabbitMQ container")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -130,7 +130,7 @@ public static IResourceBuilder WithDataBindMount(this IR /// The resource builder. /// The . /// Thrown when the current container image and tag do not match the defaults for . - [AspireExport("withManagementPlugin", Description = "Enables the RabbitMQ management plugin")] + [AspireExport(Description = "Enables the RabbitMQ management plugin")] public static IResourceBuilder WithManagementPlugin(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs b/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs index e65ee998e83..3fc1151f74c 100644 --- a/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs +++ b/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs @@ -58,7 +58,7 @@ public static IResourceBuilder AddRedis(this IDistributedApplicat /// /// This version of the package defaults to the tag of the container image. /// - [AspireExport("addRedis", Description = "Adds a Redis container resource")] + [AspireExport(Description = "Adds a Redis container resource")] public static IResourceBuilder AddRedis( this IDistributedApplicationBuilder builder, [ResourceName] string name, @@ -209,7 +209,7 @@ public static IResourceBuilder AddRedis( /// Configuration callback for Redis Commander container resource. /// Override the container name used for Redis Commander. /// - [AspireExport("withRedisCommander", Description = "Adds Redis Commander management UI", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds Redis Commander management UI", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithRedisCommander(this IResourceBuilder builder, Action>? configureContainer = null, string? containerName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -287,7 +287,7 @@ public static IResourceBuilder WithRedisCommander(this IResourceB /// Configuration callback for Redis Insight container resource. /// Override the container name used for Redis Insight. /// - [AspireExport("withRedisInsight", Description = "Adds Redis Insight management UI", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Adds Redis Insight management UI", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithRedisInsight(this IResourceBuilder builder, Action>? configureContainer = null, string? containerName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -434,7 +434,7 @@ public static IResourceBuilder WithHostPort(this IResource /// Defaults to false. /// /// The . - [AspireExport("withDataVolume", Description = "Adds a data volume with persistence")] + [AspireExport(Description = "Adds a data volume with persistence")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -465,7 +465,7 @@ public static IResourceBuilder WithDataVolume(this IResourceBuild /// Defaults to false. /// /// The . - [AspireExport("withDataBindMount", Description = "Adds a data bind mount with persistence")] + [AspireExport(Description = "Adds a data bind mount with persistence")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -495,7 +495,7 @@ public static IResourceBuilder WithDataBindMount(this IResourceBu /// The interval between snapshot exports. Defaults to 60 seconds. /// The number of key change operations required to trigger a snapshot at the interval. Defaults to 1. /// The . - [AspireExport("withPersistence", Description = "Configures Redis persistence")] + [AspireExport(Description = "Configures Redis persistence")] public static IResourceBuilder WithPersistence(this IResourceBuilder builder, TimeSpan? interval = null, long keysChangedThreshold = 1) { ArgumentNullException.ThrowIfNull(builder); @@ -546,7 +546,7 @@ public static IResourceBuilder WithDataBindMount(this IRes /// The resource builder. /// The parameter used to provide the password for the Redis resource. If , no password will be configured. /// The . - [AspireExport("withPassword", Description = "Configures the password for Redis")] + [AspireExport(Description = "Configures the password for Redis")] public static IResourceBuilder WithPassword(this IResourceBuilder builder, IResourceBuilder? password) { ArgumentNullException.ThrowIfNull(builder); @@ -561,7 +561,7 @@ public static IResourceBuilder WithPassword(this IResourceBuilder /// The resource builder. /// The port to bind on the host. If is used random port will be assigned. /// The . - [AspireExport("withHostPort", Description = "Sets the host port for Redis")] + [AspireExport(Description = "Sets the host port for Redis")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.RemoteHost/AtsCapabilityScanner.cs b/src/Aspire.Hosting.RemoteHost/AtsCapabilityScanner.cs index 184007ddae5..fedb4ca254a 100644 --- a/src/Aspire.Hosting.RemoteHost/AtsCapabilityScanner.cs +++ b/src/Aspire.Hosting.RemoteHost/AtsCapabilityScanner.cs @@ -1303,13 +1303,20 @@ private static ContextTypeCapabilitiesResult CreateContextTypeCapabilities( methodCapabilityName = customMethodName; methodCapabilityId = $"{package}/{customMethodName}"; } - else + else if (exposeAllMethods) { - // Auto-exposed via ExposeMethods=true - use TypeName.methodName pattern + // Auto-exposed via ExposeMethods=true - use TypeName.methodName pattern to avoid collisions var camelCaseMethodName = ToCamelCase(method.Name); methodCapabilityName = $"{typeName}.{camelCaseMethodName}"; methodCapabilityId = $"{package}/{methodCapabilityName}"; } + else + { + // Explicit [AspireExport] without Id - use plain methodName like static exports + var camelCaseMethodName = ToCamelCase(method.Name); + methodCapabilityName = camelCaseMethodName; + methodCapabilityId = $"{package}/{camelCaseMethodName}"; + } // Build parameters (first parameter is the context/instance) var paramInfos = new List @@ -1409,14 +1416,23 @@ private static ContextTypeCapabilitiesResult CreateContextTypeCapabilities( diagnostic = null; var methodLocation = $"{method.DeclaringType?.FullName ?? method.DeclaringType?.Name ?? "Unknown"}.{method.Name}"; - // Get method name from attribute - var methodNameFromAttr = exportAttr.Id; - if (string.IsNullOrEmpty(methodNameFromAttr)) + // Get method name from attribute, falling back to the camelCase of the method name + var rawId = exportAttr.Id; + string methodNameFromAttr; + if (rawId is not null) { - diagnostic = AtsDiagnostic.Warning( - $"[AspireExport] attribute on '{methodLocation}' is missing method name argument", - methodLocation); - return null; + if (string.IsNullOrWhiteSpace(rawId)) + { + diagnostic = AtsDiagnostic.Warning( + $"[AspireExport] attribute on '{methodLocation}' has an empty method name argument", + methodLocation); + return null; + } + methodNameFromAttr = rawId; + } + else + { + methodNameFromAttr = ToCamelCase(method.Name); } // Get named arguments diff --git a/src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs b/src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs index 51006b70c15..7c612166064 100644 --- a/src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs +++ b/src/Aspire.Hosting.Seq/SeqBuilderExtensions.cs @@ -42,7 +42,7 @@ public static IResourceBuilder AddSeq( /// The name to give the resource. /// The admin password for Seq. If not provided, authentication will be disabled. /// The host port for the Seq server. - [AspireExport("addSeq", Description = "Adds a Seq server container resource")] + [AspireExport(Description = "Adds a Seq server container resource")] public static IResourceBuilder AddSeq( this IDistributedApplicationBuilder builder, string name, @@ -79,7 +79,7 @@ public static IResourceBuilder AddSeq( /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a data volume for Seq")] + [AspireExport(Description = "Adds a data volume for Seq")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -94,7 +94,7 @@ public static IResourceBuilder WithDataVolume(this IResourceBuilder /// The source directory on the host to mount into the container. /// A flag that indicates if this is a read-only mount. /// The . - [AspireExport("withDataBindMount", Description = "Adds a data bind mount for Seq")] + [AspireExport(Description = "Adds a data bind mount for Seq")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs b/src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs index a90962ab290..3f070fa7ab0 100644 --- a/src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs +++ b/src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs @@ -33,7 +33,7 @@ public static partial class SqlServerBuilderExtensions /// The parameter used to provide the administrator password for the SQL Server resource. If a random password will be generated. /// The host port for the SQL Server. /// A reference to the . - [AspireExport("addSqlServer", Description = "Adds a SQL Server container resource")] + [AspireExport(Description = "Adds a SQL Server container resource")] public static IResourceBuilder AddSqlServer(this IDistributedApplicationBuilder builder, [ResourceName] string name, IResourceBuilder? password = null, int? port = null) { ArgumentNullException.ThrowIfNull(builder); @@ -111,7 +111,7 @@ public static IResourceBuilder AddSqlServer(this IDistr /// The database creation happens automatically as part of the resource lifecycle. /// /// - [AspireExport("addDatabase", Description = "Adds a SQL Server database resource")] + [AspireExport(Description = "Adds a SQL Server database resource")] public static IResourceBuilder AddDatabase(this IResourceBuilder builder, [ResourceName] string name, string? databaseName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -150,7 +150,7 @@ public static IResourceBuilder AddDatabase(this IReso /// The name of the volume. Defaults to an auto-generated name based on the application and resource names. /// A flag that indicates if this is a read-only volume. /// The . - [AspireExport("withDataVolume", Description = "Adds a named volume for the SQL Server data folder")] + [AspireExport(Description = "Adds a named volume for the SQL Server data folder")] public static IResourceBuilder WithDataVolume(this IResourceBuilder builder, string? name = null, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -169,7 +169,7 @@ public static IResourceBuilder WithDataVolume(this IRes /// The container starts up as non-root and the directory must be readable by the user that the container runs as. /// https://learn.microsoft.com/sql/linux/sql-server-linux-docker-container-configure?view=sql-server-ver16&pivots=cs1-bash#mount-a-host-directory-as-data-volume /// - [AspireExport("withDataBindMount", Description = "Adds a bind mount for the SQL Server data folder")] + [AspireExport(Description = "Adds a bind mount for the SQL Server data folder")] public static IResourceBuilder WithDataBindMount(this IResourceBuilder builder, string source, bool isReadOnly = false) { ArgumentNullException.ThrowIfNull(builder); @@ -205,7 +205,7 @@ public static IResourceBuilder WithDataBindMount(this I /// /// Default script is IF ( NOT EXISTS ( SELECT 1 FROM sys.databases WHERE name = @DatabaseName ) ) CREATE DATABASE [<QUOTED_DATABASE_NAME%gt;]; /// - [AspireExport("withCreationScript", Description = "Defines the SQL script used to create the database")] + [AspireExport(Description = "Defines the SQL script used to create the database")] public static IResourceBuilder WithCreationScript(this IResourceBuilder builder, string script) { ArgumentNullException.ThrowIfNull(builder); @@ -222,7 +222,7 @@ public static IResourceBuilder WithCreationScript(thi /// The resource builder. /// The parameter used to provide the password for the SqlServer resource. /// The . - [AspireExport("withPassword", Description = "Configures the password for the SQL Server resource")] + [AspireExport(Description = "Configures the password for the SQL Server resource")] public static IResourceBuilder WithPassword(this IResourceBuilder builder, IResourceBuilder password) { ArgumentNullException.ThrowIfNull(builder); @@ -238,7 +238,7 @@ public static IResourceBuilder WithPassword(this IResou /// The resource builder. /// The port to bind on the host. If is used random port will be assigned. /// The . - [AspireExport("withHostPort", Description = "Sets the host port for the SQL Server resource")] + [AspireExport(Description = "Sets the host port for the SQL Server resource")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting.Testing/DistributedApplicationHostingTestingExtensions.cs b/src/Aspire.Hosting.Testing/DistributedApplicationHostingTestingExtensions.cs index 7e0fd2ffd7d..b52d439adc9 100644 --- a/src/Aspire.Hosting.Testing/DistributedApplicationHostingTestingExtensions.cs +++ b/src/Aspire.Hosting.Testing/DistributedApplicationHostingTestingExtensions.cs @@ -80,7 +80,7 @@ public static HttpClient CreateHttpClient(this DistributedApplication app, strin /// A URI representation of the endpoint. /// The resource was not found, no matching endpoint was found, or multiple endpoints were found. /// The resource has no endpoints. - [AspireExport("getEndpoint", Description = "Gets the endpoint for the specified resource.")] + [AspireExport(Description = "Gets the endpoint for the specified resource.")] public static Uri GetEndpoint(this DistributedApplication app, string resourceName, string? endpointName = default) { ArgumentNullException.ThrowIfNull(app); @@ -119,7 +119,7 @@ public static Uri GetEndpointForNetwork(this DistributedApplication app, string /// A URI representation of the endpoint. /// The resource was not found, no matching endpoint was found, or multiple endpoints were found. /// The resource has no endpoints. - [AspireExport("getEndpointForNetwork", Description = "Gets the endpoint for the specified resource in the specified network context.")] + [AspireExport(Description = "Gets the endpoint for the specified resource in the specified network context.")] internal static Uri GetEndpointForNetworkExport(this DistributedApplication app, string resourceName, string? networkIdentifier = default, string? endpointName = default) { return app.GetEndpointForNetwork(resourceName, networkIdentifier is null ? null : new NetworkIdentifier(networkIdentifier), endpointName); diff --git a/src/Aspire.Hosting.Valkey/ValkeyBuilderExtensions.cs b/src/Aspire.Hosting.Valkey/ValkeyBuilderExtensions.cs index 43e4ffd12b4..cdce43fd157 100644 --- a/src/Aspire.Hosting.Valkey/ValkeyBuilderExtensions.cs +++ b/src/Aspire.Hosting.Valkey/ValkeyBuilderExtensions.cs @@ -107,7 +107,7 @@ public static IResourceBuilder AddValkey( /// /// /// A reference to the . - [AspireExport("addValkey", Description = "Adds a Valkey container resource")] + [AspireExport(Description = "Adds a Valkey container resource")] public static IResourceBuilder AddValkey( this IDistributedApplicationBuilder builder, [ResourceName] string name, @@ -203,7 +203,7 @@ public static IResourceBuilder AddValkey( /// /// /// The . - [AspireExport("withDataVolume", Description = "Adds a data volume for Valkey and enables persistence")] + [AspireExport(Description = "Adds a data volume for Valkey and enables persistence")] public static IResourceBuilder WithDataVolume( this IResourceBuilder builder, string? name = null, @@ -241,7 +241,7 @@ public static IResourceBuilder WithDataVolume( /// /// /// The . - [AspireExport("withDataBindMount", Description = "Adds a data bind mount for Valkey and enables persistence")] + [AspireExport(Description = "Adds a data bind mount for Valkey and enables persistence")] public static IResourceBuilder WithDataBindMount( this IResourceBuilder builder, string source, @@ -277,7 +277,7 @@ public static IResourceBuilder WithDataBindMount( /// /// /// The . - [AspireExport("withPersistence", Description = "Configures Valkey persistence")] + [AspireExport(Description = "Configures Valkey persistence")] public static IResourceBuilder WithPersistence( this IResourceBuilder builder, TimeSpan? interval = null, diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/IYarpConfigurationBuilder.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/IYarpConfigurationBuilder.cs index 4a3cb8d0264..5aadc0c7b7f 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/IYarpConfigurationBuilder.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/IYarpConfigurationBuilder.cs @@ -87,7 +87,7 @@ public static class YarpConfigurationBuilderExtensions /// The builder instance. /// The endpoint target for this cluster. /// The created cluster. - [AspireExport("addClusterFromEndpoint", Description = "Adds a YARP cluster for an endpoint reference.")] + [AspireExport(Description = "Adds a YARP cluster for an endpoint reference.")] internal static YarpCluster AddClusterFromEndpoint(this IYarpConfigurationBuilder builder, EndpointReference endpoint) { return builder.AddCluster(endpoint); @@ -99,7 +99,7 @@ internal static YarpCluster AddClusterFromEndpoint(this IYarpConfigurationBuilde /// The builder instance. /// The resource target for this cluster. /// The created cluster. - [AspireExport("addClusterFromResource", Description = "Adds a YARP cluster for a resource that supports service discovery.")] + [AspireExport(Description = "Adds a YARP cluster for a resource that supports service discovery.")] internal static YarpCluster AddClusterFromResource(this IYarpConfigurationBuilder builder, IResourceBuilder resource) { return builder.AddCluster(resource); @@ -111,7 +111,7 @@ internal static YarpCluster AddClusterFromResource(this IYarpConfigurationBuilde /// The builder instance. /// The external service used by this cluster. /// The created cluster. - [AspireExport("addClusterFromExternalService", Description = "Adds a YARP cluster for an external service resource.")] + [AspireExport(Description = "Adds a YARP cluster for an external service resource.")] internal static YarpCluster AddClusterFromExternalService(this IYarpConfigurationBuilder builder, IResourceBuilder externalService) { return builder.AddCluster(externalService); @@ -124,7 +124,7 @@ internal static YarpCluster AddClusterFromExternalService(this IYarpConfiguratio /// The name of the cluster. /// The destinations used by this cluster. /// The created cluster. - [AspireExport("addClusterWithDestinations", Description = "Adds a YARP cluster with multiple destinations.")] + [AspireExport(Description = "Adds a YARP cluster with multiple destinations.")] internal static YarpCluster AddClusterWithDestinations(this IYarpConfigurationBuilder builder, string clusterName, object[] destinations) { return builder.AddCluster(clusterName, destinations); @@ -137,7 +137,7 @@ internal static YarpCluster AddClusterWithDestinations(this IYarpConfigurationBu /// The name of the cluster. /// The destination used by this cluster. /// The created cluster. - [AspireExport("addClusterWithDestination", Description = "Adds a YARP cluster with a single destination.")] + [AspireExport(Description = "Adds a YARP cluster with a single destination.")] internal static YarpCluster AddClusterWithDestination(this IYarpConfigurationBuilder builder, string clusterName, object destination) { return builder.AddCluster(clusterName, destination); @@ -161,7 +161,7 @@ public static YarpRoute AddRoute(this IYarpConfigurationBuilder builder, YarpClu /// The builder instance. /// The target cluster, endpoint, resource, or string destination for this route. /// The created route. - [AspireExport("addCatchAllRoute", Description = "Adds a YARP catch-all route for a cluster, endpoint, resource, or string destination target.")] + [AspireExport(Description = "Adds a YARP catch-all route for a cluster, endpoint, resource, or string destination target.")] internal static YarpRoute AddCatchAllRoute( this IYarpConfigurationBuilder builder, [AspireUnion(typeof(YarpCluster), typeof(EndpointReference), typeof(IResourceBuilder), typeof(IResourceBuilder), typeof(string))] object target) @@ -242,7 +242,7 @@ public static YarpRoute AddRoute(this IYarpConfigurationBuilder builder, string /// The path to match for this route. /// The target cluster, endpoint, resource, or string destination for this route. /// The created route. - [AspireExport("addRoute", Description = "Adds a YARP route for a cluster, endpoint, resource, or string destination target.")] + [AspireExport(Description = "Adds a YARP route for a cluster, endpoint, resource, or string destination target.")] internal static YarpRoute AddRoute( this IYarpConfigurationBuilder builder, string path, diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ForwardedTransformExtensions.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ForwardedTransformExtensions.cs index df908a1c995..e29786177f8 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ForwardedTransformExtensions.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ForwardedTransformExtensions.cs @@ -14,7 +14,7 @@ public static class ForwardedTransformExtensions /// /// Adds the transform which will add X-Forwarded-* headers. /// - [AspireExport("withTransformXForwarded", Description = "Adds the transform which will add X-Forwarded-* headers.")] + [AspireExport(Description = "Adds the transform which will add X-Forwarded-* headers.")] public static YarpRoute WithTransformXForwarded( this YarpRoute route, string headerPrefix = "X-Forwarded-", @@ -31,7 +31,7 @@ public static YarpRoute WithTransformXForwarded( /// /// Adds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239). /// - [AspireExport("withTransformForwarded", Description = "Adds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239).")] + [AspireExport(Description = "Adds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239).")] public static YarpRoute WithTransformForwarded(this YarpRoute route, bool useHost = true, bool useProto = true, NodeFormat forFormat = NodeFormat.Random, NodeFormat byFormat = NodeFormat.Random, ForwardedTransformActions action = ForwardedTransformActions.Set) { @@ -42,7 +42,7 @@ public static YarpRoute WithTransformForwarded(this YarpRoute route, bool useHos /// /// Adds the transform which will set the given header with the Base64 encoded client certificate. /// - [AspireExport("withTransformClientCertHeader", Description = "Adds the transform which will set the given header with the Base64 encoded client certificate.")] + [AspireExport(Description = "Adds the transform which will set the given header with the Base64 encoded client certificate.")] public static YarpRoute WithTransformClientCertHeader(this YarpRoute route, string headerName) { route.Configure(r => r.WithTransformClientCertHeader(headerName)); diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/HttpMethodTransformExtensions.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/HttpMethodTransformExtensions.cs index fd3d0c36030..c8a9f6c96fe 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/HttpMethodTransformExtensions.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/HttpMethodTransformExtensions.cs @@ -14,7 +14,7 @@ public static class HttpMethodTransformExtensions /// /// Adds the transform that will replace the HTTP method if it matches. /// - [AspireExport("withTransformHttpMethodChange", Description = "Adds the transform that will replace the HTTP method if it matches.")] + [AspireExport(Description = "Adds the transform that will replace the HTTP method if it matches.")] public static YarpRoute WithTransformHttpMethodChange(this YarpRoute route, string fromHttpMethod, string toHttpMethod) { route.Configure(r => r.WithTransformHttpMethodChange(fromHttpMethod, toHttpMethod)); diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/PathTransformExtensions.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/PathTransformExtensions.cs index 58be32fca9a..2161396847a 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/PathTransformExtensions.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/PathTransformExtensions.cs @@ -36,7 +36,7 @@ public static YarpRoute WithTransformPathSet(this YarpRoute route, PathString pa /// The route to configure. /// The path value to set. /// The configured . - [AspireExport("withTransformPathSet", Description = "Adds the transform which sets the request path with the given value.")] + [AspireExport(Description = "Adds the transform which sets the request path with the given value.")] internal static YarpRoute WithTransformPathSet(this YarpRoute route, string path) { ArgumentNullException.ThrowIfNull(route); @@ -68,7 +68,7 @@ public static YarpRoute WithTransformPathPrefix(this YarpRoute route, PathString /// The route to configure. /// The path prefix to add. /// The configured . - [AspireExport("withTransformPathPrefix", Description = "Adds the transform which will prefix the request path with the given value.")] + [AspireExport(Description = "Adds the transform which will prefix the request path with the given value.")] internal static YarpRoute WithTransformPathPrefix(this YarpRoute route, string prefix) { ArgumentNullException.ThrowIfNull(route); @@ -100,7 +100,7 @@ public static YarpRoute WithTransformPathRemovePrefix(this YarpRoute route, Path /// The route to configure. /// The matching prefix to remove. /// The configured . - [AspireExport("withTransformPathRemovePrefix", Description = "Adds the transform which will remove the matching prefix from the request path.")] + [AspireExport(Description = "Adds the transform which will remove the matching prefix from the request path.")] internal static YarpRoute WithTransformPathRemovePrefix(this YarpRoute route, string prefix) { ArgumentNullException.ThrowIfNull(route); @@ -132,7 +132,7 @@ public static YarpRoute WithTransformPathRouteValues(this YarpRoute route, [Stri /// The route to configure. /// The route pattern to apply. /// The configured . - [AspireExport("withTransformPathRouteValues", Description = "Adds the transform which will set the request path with route values.")] + [AspireExport(Description = "Adds the transform which will set the request path with route values.")] internal static YarpRoute WithTransformPathRouteValues(this YarpRoute route, [StringSyntax("Route")] string pattern) { ArgumentNullException.ThrowIfNull(route); diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/QueryTransformExtensions.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/QueryTransformExtensions.cs index e4910dbc2ce..341e68ecf55 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/QueryTransformExtensions.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/QueryTransformExtensions.cs @@ -14,7 +14,7 @@ public static class QueryTransformExtensions /// /// Adds the transform that will append or set the query parameter from the given value. /// - [AspireExport("withTransformQueryValue", Description = "Adds the transform that will append or set the query parameter from the given value.")] + [AspireExport(Description = "Adds the transform that will append or set the query parameter from the given value.")] public static YarpRoute WithTransformQueryValue(this YarpRoute route, string queryKey, string value, bool append = true) { route.Configure(r => r.WithTransformQueryValue(queryKey, value, append)); @@ -24,7 +24,7 @@ public static YarpRoute WithTransformQueryValue(this YarpRoute route, string que /// /// Adds the transform that will append or set the query parameter from a route value. /// - [AspireExport("withTransformQueryRouteValue", Description = "Adds the transform that will append or set the query parameter from a route value.")] + [AspireExport(Description = "Adds the transform that will append or set the query parameter from a route value.")] public static YarpRoute WithTransformQueryRouteValue(this YarpRoute route, string queryKey, string routeValueKey, bool append = true) { route.Configure(r => r.WithTransformQueryRouteValue(queryKey, routeValueKey, append)); @@ -34,7 +34,7 @@ public static YarpRoute WithTransformQueryRouteValue(this YarpRoute route, strin /// /// Adds the transform that will remove the given query key. /// - [AspireExport("withTransformQueryRemoveKey", Description = "Adds the transform that will remove the given query key.")] + [AspireExport(Description = "Adds the transform that will remove the given query key.")] public static YarpRoute WithTransformQueryRemoveKey(this YarpRoute route, string queryKey) { route.Configure(r => r.WithTransformQueryRemoveKey(queryKey)); diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/RequestHeadersTransformExtensions.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/RequestHeadersTransformExtensions.cs index 5a8df8eeed0..a06f5faa146 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/RequestHeadersTransformExtensions.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/RequestHeadersTransformExtensions.cs @@ -13,7 +13,7 @@ public static class RequestHeadersTransformExtensions /// /// Adds the transform which will enable or suppress copying request headers to the proxy request. /// - [AspireExport("withTransformCopyRequestHeaders", Description = "Adds the transform which will enable or suppress copying request headers to the proxy request.")] + [AspireExport(Description = "Adds the transform which will enable or suppress copying request headers to the proxy request.")] public static YarpRoute WithTransformCopyRequestHeaders(this YarpRoute route, bool copy = true) { route.Configure(r => r.WithTransformCopyRequestHeaders(copy)); @@ -23,7 +23,7 @@ public static YarpRoute WithTransformCopyRequestHeaders(this YarpRoute route, bo /// /// Adds the transform which will copy the incoming request Host header to the proxy request. /// - [AspireExport("withTransformUseOriginalHostHeader", Description = "Adds the transform which will copy the incoming request Host header to the proxy request.")] + [AspireExport(Description = "Adds the transform which will copy the incoming request Host header to the proxy request.")] public static YarpRoute WithTransformUseOriginalHostHeader(this YarpRoute route, bool useOriginal = true) { route.Configure(r => r.WithTransformUseOriginalHostHeader(useOriginal)); @@ -33,7 +33,7 @@ public static YarpRoute WithTransformUseOriginalHostHeader(this YarpRoute route, /// /// Adds the transform which will append or set the request header. /// - [AspireExport("withTransformRequestHeader", Description = "Adds the transform which will append or set the request header.")] + [AspireExport(Description = "Adds the transform which will append or set the request header.")] public static YarpRoute WithTransformRequestHeader(this YarpRoute route, string headerName, string value, bool append = true) { route.Configure(r => r.WithTransformRequestHeader(headerName, value, append)); @@ -43,7 +43,7 @@ public static YarpRoute WithTransformRequestHeader(this YarpRoute route, string /// /// Adds the transform which will append or set the request header from a route value. /// - [AspireExport("withTransformRequestHeaderRouteValue", Description = "Adds the transform which will append or set the request header from a route value.")] + [AspireExport(Description = "Adds the transform which will append or set the request header from a route value.")] public static YarpRoute WithTransformRequestHeaderRouteValue(this YarpRoute route, string headerName, string routeValueKey, bool append = true) { route.Configure(r => r.WithTransformRequestHeaderRouteValue(headerName, routeValueKey, append)); @@ -53,7 +53,7 @@ public static YarpRoute WithTransformRequestHeaderRouteValue(this YarpRoute rout /// /// Adds the transform which will remove the request header. /// - [AspireExport("withTransformRequestHeaderRemove", Description = "Adds the transform which will remove the request header.")] + [AspireExport(Description = "Adds the transform which will remove the request header.")] public static YarpRoute WithTransformRequestHeaderRemove(this YarpRoute route, string headerName) { route.Configure(r => r.WithTransformRequestHeaderRemove(headerName)); @@ -64,7 +64,7 @@ public static YarpRoute WithTransformRequestHeaderRemove(this YarpRoute route, s /// Adds the transform which will only copy the allowed request headers. Other transforms /// that modify or append to existing headers may be affected if not included in the allow list. /// - [AspireExport("withTransformRequestHeadersAllowed", Description = "Adds the transform which will only copy the allowed request headers. Other transforms")] + [AspireExport(Description = "Adds the transform which will only copy the allowed request headers. Other transforms")] public static YarpRoute WithTransformRequestHeadersAllowed(this YarpRoute route, params string[] allowedHeaders) { route.Configure(r => r.WithTransformRequestHeadersAllowed(allowedHeaders)); diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ResponseTransformExtensions.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ResponseTransformExtensions.cs index 0c77b82789b..f6ab388ab00 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ResponseTransformExtensions.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/Transforms/ResponseTransformExtensions.cs @@ -13,7 +13,7 @@ public static class ResponseTransformExtensions /// /// Adds the transform which will enable or suppress copying response headers to the client response. /// - [AspireExport("withTransformCopyResponseHeaders", Description = "Adds the transform which will enable or suppress copying response headers to the client response.")] + [AspireExport(Description = "Adds the transform which will enable or suppress copying response headers to the client response.")] public static YarpRoute WithTransformCopyResponseHeaders(this YarpRoute route, bool copy = true) { route.Configure(r => r.WithTransformCopyResponseHeaders(copy)); @@ -23,7 +23,7 @@ public static YarpRoute WithTransformCopyResponseHeaders(this YarpRoute route, b /// /// Adds the transform which will enable or suppress copying response trailers to the client response. /// - [AspireExport("withTransformCopyResponseTrailers", Description = "Adds the transform which will enable or suppress copying response trailers to the client response.")] + [AspireExport(Description = "Adds the transform which will enable or suppress copying response trailers to the client response.")] public static YarpRoute WithTransformCopyResponseTrailers(this YarpRoute route, bool copy = true) { route.Configure(r => r.WithTransformCopyResponseTrailers(copy)); @@ -33,7 +33,7 @@ public static YarpRoute WithTransformCopyResponseTrailers(this YarpRoute route, /// /// Adds the transform which will append or set the response header. /// - [AspireExport("withTransformResponseHeader", Description = "Adds the transform which will append or set the response header.")] + [AspireExport(Description = "Adds the transform which will append or set the response header.")] public static YarpRoute WithTransformResponseHeader(this YarpRoute route, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success) { route.Configure(r => r.WithTransformResponseHeader(headerName, value, append, condition)); @@ -43,7 +43,7 @@ public static YarpRoute WithTransformResponseHeader(this YarpRoute route, string /// /// Adds the transform which will remove the response header. /// - [AspireExport("withTransformResponseHeaderRemove", Description = "Adds the transform which will remove the response header.")] + [AspireExport(Description = "Adds the transform which will remove the response header.")] public static YarpRoute WithTransformResponseHeaderRemove(this YarpRoute route, string headerName, ResponseCondition condition = ResponseCondition.Success) { route.Configure(r => r.WithTransformResponseHeaderRemove(headerName, condition)); @@ -54,7 +54,7 @@ public static YarpRoute WithTransformResponseHeaderRemove(this YarpRoute route, /// Adds the transform which will only copy the allowed response headers. Other transforms /// that modify or append to existing headers may be affected if not included in the allow list. /// - [AspireExport("withTransformResponseHeadersAllowed", Description = "Adds the transform which will only copy the allowed response headers. Other transforms")] + [AspireExport(Description = "Adds the transform which will only copy the allowed response headers. Other transforms")] public static YarpRoute WithTransformResponseHeadersAllowed(this YarpRoute route, params string[] allowedHeaders) { route.Configure(r => r.WithTransformResponseHeadersAllowed(allowedHeaders)); @@ -64,7 +64,7 @@ public static YarpRoute WithTransformResponseHeadersAllowed(this YarpRoute route /// /// Adds the transform which will append or set the response trailer. /// - [AspireExport("withTransformResponseTrailer", Description = "Adds the transform which will append or set the response trailer.")] + [AspireExport(Description = "Adds the transform which will append or set the response trailer.")] public static YarpRoute WithTransformResponseTrailer(this YarpRoute route, string headerName, string value, bool append = true, ResponseCondition condition = ResponseCondition.Success) { route.Configure(r => r.WithTransformResponseTrailer(headerName, value, append, condition)); @@ -74,7 +74,7 @@ public static YarpRoute WithTransformResponseTrailer(this YarpRoute route, strin /// /// Adds the transform which will remove the response trailer. /// - [AspireExport("withTransformResponseTrailerRemove", Description = "Adds the transform which will remove the response trailer.")] + [AspireExport(Description = "Adds the transform which will remove the response trailer.")] public static YarpRoute WithTransformResponseTrailerRemove(this YarpRoute route, string headerName, ResponseCondition condition = ResponseCondition.Success) { route.Configure(r => r.WithTransformResponseTrailerRemove(headerName, condition)); @@ -85,7 +85,7 @@ public static YarpRoute WithTransformResponseTrailerRemove(this YarpRoute route, /// Adds the transform which will only copy the allowed response trailers. Other transforms /// that modify or append to existing trailers may be affected if not included in the allow list. /// - [AspireExport("withTransformResponseTrailersAllowed", Description = "Adds the transform which will only copy the allowed response trailers. Other transforms")] + [AspireExport(Description = "Adds the transform which will only copy the allowed response trailers. Other transforms")] public static YarpRoute WithTransformResponseTrailersAllowed(this YarpRoute route, params string[] allowedHeaders) { route.Configure(r => r.WithTransformResponseTrailersAllowed(allowedHeaders)); diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpCluster.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpCluster.cs index ffb12583329..195b329b4dd 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpCluster.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpCluster.cs @@ -124,7 +124,7 @@ public static YarpCluster WithForwarderRequestConfig(this YarpCluster cluster, F /// /// Set the forwarder request configuration for the cluster. /// - [AspireExport("withForwarderRequestConfig", Description = "Sets the forwarder request configuration for the cluster.")] + [AspireExport(Description = "Sets the forwarder request configuration for the cluster.")] internal static YarpCluster WithForwarderRequestConfig(this YarpCluster cluster, YarpForwarderRequestConfig config) { ArgumentNullException.ThrowIfNull(config); @@ -147,7 +147,7 @@ public static YarpCluster WithHttpClientConfig(this YarpCluster cluster, HttpCli /// /// Set the HTTP client configuration for the cluster. /// - [AspireExport("withHttpClientConfig", Description = "Sets the HTTP client configuration for the cluster.")] + [AspireExport(Description = "Sets the HTTP client configuration for the cluster.")] internal static YarpCluster WithHttpClientConfig(this YarpCluster cluster, YarpHttpClientConfig config) { ArgumentNullException.ThrowIfNull(config); @@ -170,7 +170,7 @@ public static YarpCluster WithSessionAffinityConfig(this YarpCluster cluster, Se /// /// Set the session affinity configuration for the cluster. /// - [AspireExport("withSessionAffinityConfig", Description = "Sets the session affinity configuration for the cluster.")] + [AspireExport(Description = "Sets the session affinity configuration for the cluster.")] internal static YarpCluster WithSessionAffinityConfig(this YarpCluster cluster, YarpSessionAffinityConfig config) { ArgumentNullException.ThrowIfNull(config); @@ -193,7 +193,7 @@ public static YarpCluster WithHealthCheckConfig(this YarpCluster cluster, Health /// /// Set the health check configuration for the cluster. /// - [AspireExport("withHealthCheckConfig", Description = "Sets the health check configuration for the cluster.")] + [AspireExport(Description = "Sets the health check configuration for the cluster.")] internal static YarpCluster WithHealthCheckConfig(this YarpCluster cluster, YarpHealthCheckConfig config) { ArgumentNullException.ThrowIfNull(config); @@ -205,7 +205,7 @@ internal static YarpCluster WithHealthCheckConfig(this YarpCluster cluster, Yarp /// /// Set the LoadBalancingPolicy for the cluster. /// - [AspireExport("withLoadBalancingPolicy", Description = "Sets the load balancing policy for the cluster.")] + [AspireExport(Description = "Sets the load balancing policy for the cluster.")] public static YarpCluster WithLoadBalancingPolicy(this YarpCluster cluster, string policy) { cluster.Configure(c => c with { LoadBalancingPolicy = policy }); diff --git a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpRoute.cs b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpRoute.cs index 197b24073e6..0b056460f44 100644 --- a/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpRoute.cs +++ b/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpRoute.cs @@ -54,7 +54,7 @@ public static YarpRoute WithMatch(this YarpRoute route, RouteMatch match) /// /// Set the parameters used to match requests. /// - [AspireExport("withMatch", Description = "Sets the route match criteria.")] + [AspireExport(Description = "Sets the route match criteria.")] internal static YarpRoute WithMatch(this YarpRoute route, YarpRouteMatch match) { ArgumentNullException.ThrowIfNull(match); @@ -74,7 +74,7 @@ private static YarpRoute ConfigureMatch(this YarpRoute route, Func /// Only match requests with the given Path pattern. /// - [AspireExport("withMatchPath", Description = "Matches requests with the specified path pattern.")] + [AspireExport(Description = "Matches requests with the specified path pattern.")] public static YarpRoute WithMatchPath(this YarpRoute route, string path) { route.ConfigureMatch(match => match with { Path = path }); @@ -84,7 +84,7 @@ public static YarpRoute WithMatchPath(this YarpRoute route, string path) /// /// Only match requests that use these optional HTTP methods. E.g. GET, POST. /// - [AspireExport("withMatchMethods", Description = "Matches requests that use the specified HTTP methods.")] + [AspireExport(Description = "Matches requests that use the specified HTTP methods.")] public static YarpRoute WithMatchMethods(this YarpRoute route, params string[] methods) { route.ConfigureMatch(match => match with { Methods = methods }); @@ -105,7 +105,7 @@ public static YarpRoute WithMatchHeaders(this YarpRoute route, params RouteHeade /// /// Only match requests that contain all of these headers. /// - [AspireExport("withMatchHeaders", Description = "Matches requests that contain the specified headers.")] + [AspireExport(Description = "Matches requests that contain the specified headers.")] internal static YarpRoute WithMatchHeaders(this YarpRoute route, params YarpRouteHeaderMatch[] headers) { ArgumentNullException.ThrowIfNull(headers); @@ -118,7 +118,7 @@ internal static YarpRoute WithMatchHeaders(this YarpRoute route, params YarpRout /// Only match requests with the given Host header. Supports wildcards and ports. /// For unicode host names, do not use punycode. /// - [AspireExport("withMatchHosts", Description = "Matches requests that contain the specified host headers.")] + [AspireExport(Description = "Matches requests that contain the specified host headers.")] public static YarpRoute WithMatchHosts(this YarpRoute route, params string[] hosts) { route.ConfigureMatch(match => match with { Hosts = hosts.ToList() }); @@ -139,7 +139,7 @@ public static YarpRoute WithMatchRouteQueryParameter(this YarpRoute route, param /// /// Only match requests that contain all of these query parameters. /// - [AspireExport("withMatchRouteQueryParameter", Description = "Matches requests that contain the specified query parameters.")] + [AspireExport(Description = "Matches requests that contain the specified query parameters.")] internal static YarpRoute WithMatchRouteQueryParameter(this YarpRoute route, params YarpRouteQueryParameterMatch[] queryParameters) { ArgumentNullException.ThrowIfNull(queryParameters); @@ -153,7 +153,7 @@ internal static YarpRoute WithMatchRouteQueryParameter(this YarpRoute route, par /// /// Set the order for the destination /// - [AspireExport("withOrder", Description = "Sets the route order.")] + [AspireExport(Description = "Sets the route order.")] public static YarpRoute WithOrder(this YarpRoute route, int? order) { route.Configure(r => r with { Order = order }); @@ -163,7 +163,7 @@ public static YarpRoute WithOrder(this YarpRoute route, int? order) /// /// Set the MaxRequestBodySize for the destination /// - [AspireExport("withMaxRequestBodySize", Description = "Sets the maximum request body size for the route.")] + [AspireExport(Description = "Sets the maximum request body size for the route.")] public static YarpRoute WithMaxRequestBodySize(this YarpRoute route, long maxRequestBodySize) { route.Configure(r => r with { MaxRequestBodySize = maxRequestBodySize }); @@ -183,7 +183,7 @@ public static YarpRoute WithMetadata(this YarpRoute route, IReadOnlyDictionary /// Set the Transforms of the destination /// - [AspireExport("withTransforms", Description = "Sets the transforms for the route.")] + [AspireExport(Description = "Sets the transforms for the route.")] public static YarpRoute WithTransforms(this YarpRoute route, IReadOnlyList>? transforms) { route.Configure(r => r with { Transforms = transforms }); @@ -212,7 +212,7 @@ public static YarpRoute WithTransform(this YarpRoute route, Action /// Add a new transform to the destination. /// - [AspireExport("withTransform", Description = "Adds a transform to the route.")] + [AspireExport(Description = "Adds a transform to the route.")] internal static YarpRoute WithTransform(this YarpRoute route, IReadOnlyDictionary transform) { ArgumentNullException.ThrowIfNull(transform); diff --git a/src/Aspire.Hosting.Yarp/YarpResourceExtensions.cs b/src/Aspire.Hosting.Yarp/YarpResourceExtensions.cs index 4fb590d87fc..8374c616046 100644 --- a/src/Aspire.Hosting.Yarp/YarpResourceExtensions.cs +++ b/src/Aspire.Hosting.Yarp/YarpResourceExtensions.cs @@ -26,7 +26,7 @@ public static class YarpResourceExtensions /// The . /// The name of the resource. This name will be used as the connection string name when referenced in a dependency. /// A reference to the . - [AspireExport("addYarp", Description = "Adds a YARP container to the application model.")] + [AspireExport(Description = "Adds a YARP container to the application model.")] public static IResourceBuilder AddYarp( this IDistributedApplicationBuilder builder, [ResourceName] string name) @@ -103,7 +103,7 @@ public static IResourceBuilder AddYarp( /// /// The YARP resource to configure. /// The delegate to configure YARP. - [AspireExport("withConfiguration", Description = "Configure the YARP resource.", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Configure the YARP resource.", RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithConfiguration(this IResourceBuilder builder, Action configurationBuilder) { var configBuilder = new YarpConfigurationBuilder(builder); @@ -116,7 +116,7 @@ public static IResourceBuilder WithConfiguration(this IResourceBui /// /// The resource builder for YARP. /// The port to bind on the host. If is used random port will be assigned. - [AspireExport("withHostPort", Description = "Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.")] + [AspireExport(Description = "Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.")] public static IResourceBuilder WithHostPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); @@ -134,7 +134,7 @@ public static IResourceBuilder WithHostPort(this IResourceBuilder< /// The resource builder for YARP. /// The port to bind on the host. If is used random port will be assigned. /// The updated resource builder. - [AspireExport("withHostHttpsPort", Description = "Configures the host HTTPS port that the YARP resource is exposed on instead of using randomly assigned port.")] + [AspireExport(Description = "Configures the host HTTPS port that the YARP resource is exposed on instead of using randomly assigned port.")] public static IResourceBuilder WithHostHttpsPort(this IResourceBuilder builder, int? port) { ArgumentNullException.ThrowIfNull(builder); @@ -200,7 +200,7 @@ COPY . /app/wwwroot /// The resource builder for YARP. /// The resource with container files. /// The updated resource builder. - [AspireExport("publishWithStaticFiles", Description = "In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.")] + [AspireExport(Description = "In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.")] public static IResourceBuilder PublishWithStaticFiles(this IResourceBuilder builder, IResourceBuilder resourceWithFiles) { if (!builder.ApplicationBuilder.ExecutionContext.IsPublishMode) diff --git a/src/Aspire.Hosting/ApplicationModel/EndpointReference.cs b/src/Aspire.Hosting/ApplicationModel/EndpointReference.cs index 1d987569383..30a5d7bc9ce 100644 --- a/src/Aspire.Hosting/ApplicationModel/EndpointReference.cs +++ b/src/Aspire.Hosting/ApplicationModel/EndpointReference.cs @@ -9,7 +9,7 @@ namespace Aspire.Hosting.ApplicationModel; /// /// Represents an endpoint reference for a resource with endpoints. /// -[AspireExport(ExposeProperties = true)] +[AspireExport(ExposeProperties = true, ExposeMethods = true)] [DebuggerDisplay("Resource = {Resource.Name}, EndpointName = {EndpointName}, IsAllocated = {IsAllocated}")] public sealed class EndpointReference : IExpressionValue, IManifestExpressionProvider, IValueProvider, IValueWithReferences { @@ -94,6 +94,7 @@ public sealed class EndpointReference : IExpressionValue, IManifestExpressionPro /// The cancellation token. /// The context for value resolution. /// The URL of the endpoint. + [AspireExportIgnore] public ValueTask GetValueAsync(ValueProviderContext context, CancellationToken cancellationToken = default) => Property(EndpointProperty.Url).GetValueAsync(context, cancellationToken); /// @@ -128,6 +129,7 @@ internal string GetExpression(EndpointProperty property = EndpointProperty.Url) /// /// The enum value to use in the reference. /// An representing the specified . + [AspireExportIgnore] public EndpointReferenceExpression Property(EndpointProperty property) { return new(this, property); diff --git a/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs b/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs index e37433cb04a..c58ccb114ca 100644 --- a/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs +++ b/src/Aspire.Hosting/ApplicationModel/ReferenceExpression.cs @@ -506,7 +506,7 @@ public void Append([InterpolatedStringHandlerArgument("")] in ReferenceExpressio /// Appends a literal value to the expression. /// /// The literal string value to be appended to the interpolated string. - [AspireExport("appendLiteral", Description = "Appends a literal string to the reference expression")] + [AspireExport(Description = "Appends a literal string to the reference expression")] public void AppendLiteral(string value) { _builder.Append(value); @@ -526,7 +526,7 @@ public void AppendFormatted(string? value) /// /// The formatted string to be appended to the interpolated string. /// The format to be applied to the value. e.g., "uri" - [AspireExport("appendFormatted", Description = "Appends a formatted string value to the reference expression")] + [AspireExport(Description = "Appends a formatted string value to the reference expression")] public void AppendFormatted(string? value, string? format = null) { if (value is not null) @@ -586,7 +586,7 @@ public void AppendFormatted(T valueProvider, string? format) where T : IValue /// An object that implements both interfaces, or an IResourceBuilder wrapping such an object. /// Optional format specifier. /// Thrown if the object doesn't implement the required interfaces. - [AspireExport("appendValueProvider", Description = "Appends a value provider to the reference expression")] + [AspireExport(Description = "Appends a value provider to the reference expression")] public void AppendValueProvider(object valueProvider, string? format = null) { // Unwrap IResourceBuilder to get the underlying resource (covariant interface) @@ -612,7 +612,7 @@ public void AppendValueProvider(object valueProvider, string? format = null) /// /// Builds the . /// - [AspireExport("build", Description = "Builds the reference expression")] + [AspireExport(Description = "Builds the reference expression")] public ReferenceExpression Build() => ReferenceExpression.Create(_builder.ToString(), [.. _valueProviders], [.. _manifestExpressions], [.. _stringFormats]); diff --git a/src/Aspire.Hosting/Ats/AspireExportAttribute.cs b/src/Aspire.Hosting/Ats/AspireExportAttribute.cs index 1800b9963bc..96313e723ac 100644 --- a/src/Aspire.Hosting/Ats/AspireExportAttribute.cs +++ b/src/Aspire.Hosting/Ats/AspireExportAttribute.cs @@ -16,8 +16,9 @@ namespace Aspire.Hosting; /// /// /// Capability exports (on methods): Marks a static method as an ATS capability. -/// Specify just the method name - the capability ID is computed as {AssemblyName}/{methodName}. -/// For example: "addRedis" in Aspire.Hosting.Redis becomes Aspire.Hosting.Redis/addRedis. +/// The capability ID is automatically derived as {AssemblyName}/{camelCaseMethodName}. +/// For example: AddRedis in Aspire.Hosting.Redis becomes Aspire.Hosting.Redis/addRedis. +/// Specify an explicit id only when disambiguation is needed (e.g., multiple overloads). /// /// /// @@ -43,10 +44,13 @@ namespace Aspire.Hosting; /// /// /// -/// // Capability export on a method - just specify the method name -/// [AspireExport("addRedis", Description = "Adds a Redis resource")] +/// // Capability export on a method - capability ID is auto-derived as Aspire.Hosting.Redis/addRedis +/// [AspireExport(Description = "Adds a Redis resource")] /// public static IResourceBuilder<RedisResource> AddRedis(...) { } -/// // Scanner computes capability ID: Aspire.Hosting.Redis/addRedis +/// +/// // Capability export with explicit ID for disambiguation (e.g., multiple overloads) +/// [AspireExport("addRedisWithPort", Description = "Adds a Redis resource with a specific port")] +/// public static IResourceBuilder<RedisResource> AddRedis(..., int port) { } /// /// // Type export - type ID derived as {AssemblyName}/{TypeName} /// [AspireExport] @@ -84,13 +88,13 @@ namespace Aspire.Hosting; public sealed class AspireExportAttribute : Attribute { /// - /// Initializes a new instance for a capability export (on methods). + /// Initializes a new instance for a capability export (on methods) with an explicit capability ID. /// /// - /// The method name for this capability. The full capability ID is computed - /// as {AssemblyName}/{methodName}. - /// For example: "addRedis" in Aspire.Hosting.Redis becomes - /// Aspire.Hosting.Redis/addRedis. + /// The capability name for this method. The full capability ID is computed + /// as {AssemblyName}/{id}. + /// Use this overload only when disambiguation is needed (e.g., multiple overloads of the same method). + /// When not specified, the capability ID is automatically derived from the method name using camelCase. /// public AspireExportAttribute(string id) { @@ -98,12 +102,13 @@ public AspireExportAttribute(string id) } /// - /// Initializes a new instance for a type export. + /// Initializes a new instance for a type or method export. /// /// - /// The type ID is automatically derived as {AssemblyName}/{TypeName}. + /// For type exports, the type ID is automatically derived as {AssemblyName}/{TypeName}. /// Set to true for context types whose properties /// should be exposed as get/set capabilities. + /// For method exports, the capability ID is automatically derived from the method name using camelCase. /// public AspireExportAttribute() { diff --git a/src/Aspire.Hosting/Ats/BuilderExports.cs b/src/Aspire.Hosting/Ats/BuilderExports.cs index 21c0b562a47..8bfca79182b 100644 --- a/src/Aspire.Hosting/Ats/BuilderExports.cs +++ b/src/Aspire.Hosting/Ats/BuilderExports.cs @@ -45,7 +45,7 @@ internal static class BuilderExports /// /// The distributed application builder. /// The configuration handle. - [AspireExport("getConfiguration", Description = "Gets the application configuration")] + [AspireExport(Description = "Gets the application configuration")] public static IConfiguration GetConfiguration(this IDistributedApplicationBuilder builder) { ArgumentNullException.ThrowIfNull(builder); @@ -59,7 +59,7 @@ public static IConfiguration GetConfiguration(this IDistributedApplicationBuilde /// The configuration handle. /// The configuration key (e.g., "ConnectionStrings:Default"). /// The configuration value, or null if not found. - [AspireExport("getConfigValue", Description = "Gets a configuration value by key")] + [AspireExport(Description = "Gets a configuration value by key")] public static string? GetConfigValue(this IConfiguration configuration, string key) { return configuration[key]; @@ -71,7 +71,7 @@ public static IConfiguration GetConfiguration(this IDistributedApplicationBuilde /// The configuration handle. /// The connection string name. /// The connection string value, or null if not found. - [AspireExport("getConnectionString", Description = "Gets a connection string by name")] + [AspireExport(Description = "Gets a connection string by name")] public static string? GetConnectionString(this IConfiguration configuration, string name) { ArgumentNullException.ThrowIfNull(configuration); @@ -86,7 +86,7 @@ public static IConfiguration GetConfiguration(this IDistributedApplicationBuilde /// The configuration handle. /// The configuration key. /// The configuration section handle. - [AspireExport("getSection", Description = "Gets a configuration section by key")] + [AspireExport(Description = "Gets a configuration section by key")] public static IConfigurationSection GetSection(this IConfiguration configuration, string key) { ArgumentNullException.ThrowIfNull(configuration); @@ -100,7 +100,7 @@ public static IConfigurationSection GetSection(this IConfiguration configuration /// /// The configuration handle. /// The child sections. - [AspireExport("getChildren", Description = "Gets child configuration sections")] + [AspireExport(Description = "Gets child configuration sections")] public static IConfigurationSection[] GetChildren(this IConfiguration configuration) { ArgumentNullException.ThrowIfNull(configuration); @@ -114,7 +114,7 @@ public static IConfigurationSection[] GetChildren(this IConfiguration configurat /// The configuration handle. /// The configuration key. /// when the section exists; otherwise, . - [AspireExport("exists", Description = "Checks whether a configuration section exists")] + [AspireExport(Description = "Checks whether a configuration section exists")] public static bool Exists(this IConfiguration configuration, string key) { ArgumentNullException.ThrowIfNull(configuration); @@ -132,7 +132,7 @@ public static bool Exists(this IConfiguration configuration, string key) /// /// The host environment handle. /// True if running in Development environment. - [AspireExport("isDevelopment", Description = "Checks if running in Development environment")] + [AspireExport(Description = "Checks if running in Development environment")] public static bool IsDevelopment(this IHostEnvironment environment) { ArgumentNullException.ThrowIfNull(environment); @@ -145,7 +145,7 @@ public static bool IsDevelopment(this IHostEnvironment environment) /// /// The host environment handle. /// True if running in Production environment. - [AspireExport("isProduction", Description = "Checks if running in Production environment")] + [AspireExport(Description = "Checks if running in Production environment")] public static bool IsProduction(this IHostEnvironment environment) { ArgumentNullException.ThrowIfNull(environment); @@ -158,7 +158,7 @@ public static bool IsProduction(this IHostEnvironment environment) /// /// The host environment handle. /// True if running in Staging environment. - [AspireExport("isStaging", Description = "Checks if running in Staging environment")] + [AspireExport(Description = "Checks if running in Staging environment")] public static bool IsStaging(this IHostEnvironment environment) { ArgumentNullException.ThrowIfNull(environment); @@ -172,7 +172,7 @@ public static bool IsStaging(this IHostEnvironment environment) /// The host environment handle. /// The environment name to compare against. /// True if the environment matches the specified name. - [AspireExport("isEnvironment", Description = "Checks if the environment matches the specified name")] + [AspireExport(Description = "Checks if the environment matches the specified name")] public static bool IsEnvironment(this IHostEnvironment environment, string environmentName) { ArgumentNullException.ThrowIfNull(environment); @@ -195,7 +195,7 @@ public static bool IsEnvironment(this IHostEnvironment environment, string envir /// The builder handle. /// A callback that receives the exported event when the event fires. /// A subscription handle that can be used to unsubscribe. - [AspireExport("subscribeBeforeStart", Description = "Subscribes to the BeforeStart event")] + [AspireExport(Description = "Subscribes to the BeforeStart event")] public static DistributedApplicationEventSubscription SubscribeBeforeStart( this IDistributedApplicationBuilder builder, Func callback) @@ -219,7 +219,7 @@ public static DistributedApplicationEventSubscription SubscribeBeforeStart( /// The builder handle. /// A callback that receives the exported event when the event fires. /// A subscription handle that can be used to unsubscribe. - [AspireExport("subscribeAfterResourcesCreated", Description = "Subscribes to the AfterResourcesCreated event")] + [AspireExport(Description = "Subscribes to the AfterResourcesCreated event")] public static DistributedApplicationEventSubscription SubscribeAfterResourcesCreated( this IDistributedApplicationBuilder builder, Func callback) diff --git a/src/Aspire.Hosting/Ats/CoreExports.cs b/src/Aspire.Hosting/Ats/CoreExports.cs index 6198543a525..68b75d8b2ea 100644 --- a/src/Aspire.Hosting/Ats/CoreExports.cs +++ b/src/Aspire.Hosting/Ats/CoreExports.cs @@ -76,7 +76,7 @@ internal static class CoreExports /// The volume name. If null, an anonymous volume is created. /// Whether the volume is read-only. /// The same resource builder handle for chaining. - [AspireExport("withVolume", Description = "Adds a volume")] + [AspireExport(Description = "Adds a volume")] public static IResourceBuilder WithVolume( this IResourceBuilder resource, string target, @@ -100,7 +100,7 @@ public static IResourceBuilder WithVolume( /// /// The resource builder handle. /// The resource name. - [AspireExport("getResourceName", Description = "Gets the resource name")] + [AspireExport(Description = "Gets the resource name")] public static string GetResourceName(this IResourceBuilder resource) { return resource.Resource.Name; diff --git a/src/Aspire.Hosting/Ats/EventingExports.cs b/src/Aspire.Hosting/Ats/EventingExports.cs index 755901dbbbf..42608779e53 100644 --- a/src/Aspire.Hosting/Ats/EventingExports.cs +++ b/src/Aspire.Hosting/Ats/EventingExports.cs @@ -17,7 +17,7 @@ internal static class EventingExports /// /// The service provider handle. /// The distributed application eventing handle. - [AspireExport("getEventing", Description = "Gets the distributed application eventing service from the service provider")] + [AspireExport(Description = "Gets the distributed application eventing service from the service provider")] internal static IDistributedApplicationEventing GetEventing(this IServiceProvider serviceProvider) { ArgumentNullException.ThrowIfNull(serviceProvider); @@ -31,7 +31,7 @@ internal static IDistributedApplicationEventing GetEventing(this IServiceProvide /// The resource builder. /// The callback to invoke when the event fires. /// The resource builder. - [AspireExport("onBeforeResourceStarted", Description = "Subscribes to the BeforeResourceStarted event")] + [AspireExport(Description = "Subscribes to the BeforeResourceStarted event")] internal static IResourceBuilder OnBeforeResourceStarted(this IResourceBuilder builder, Func callback) where T : IResource { @@ -47,7 +47,7 @@ internal static IResourceBuilder OnBeforeResourceStarted(this IResourceBui /// The resource builder. /// The callback to invoke when the event fires. /// The resource builder. - [AspireExport("onResourceStopped", Description = "Subscribes to the ResourceStopped event")] + [AspireExport(Description = "Subscribes to the ResourceStopped event")] internal static IResourceBuilder OnResourceStopped(this IResourceBuilder builder, Func callback) where T : IResource { @@ -63,7 +63,7 @@ internal static IResourceBuilder OnResourceStopped(this IResourceBuilderThe resource builder. /// The callback to invoke when the event fires. /// The resource builder. - [AspireExport("onConnectionStringAvailable", Description = "Subscribes to the ConnectionStringAvailable event")] + [AspireExport(Description = "Subscribes to the ConnectionStringAvailable event")] internal static IResourceBuilder OnConnectionStringAvailable(this IResourceBuilder builder, Func callback) where T : IResourceWithConnectionString { @@ -79,7 +79,7 @@ internal static IResourceBuilder OnConnectionStringAvailable(this IResourc /// The resource builder. /// The callback to invoke when the event fires. /// The resource builder. - [AspireExport("onInitializeResource", Description = "Subscribes to the InitializeResource event")] + [AspireExport(Description = "Subscribes to the InitializeResource event")] internal static IResourceBuilder OnInitializeResource(this IResourceBuilder builder, Func callback) where T : IResource { @@ -95,7 +95,7 @@ internal static IResourceBuilder OnInitializeResource(this IResourceBuilde /// The resource builder. /// The callback to invoke when the event fires. /// The resource builder. - [AspireExport("onResourceEndpointsAllocated", Description = "Subscribes to the ResourceEndpointsAllocated event")] + [AspireExport(Description = "Subscribes to the ResourceEndpointsAllocated event")] internal static IResourceBuilder OnResourceEndpointsAllocated(this IResourceBuilder builder, Func callback) where T : IResourceWithEndpoints { @@ -111,7 +111,7 @@ internal static IResourceBuilder OnResourceEndpointsAllocated(this IResour /// The resource builder. /// The callback to invoke when the event fires. /// The resource builder. - [AspireExport("onResourceReady", Description = "Subscribes to the ResourceReady event")] + [AspireExport(Description = "Subscribes to the ResourceReady event")] internal static IResourceBuilder OnResourceReady(this IResourceBuilder builder, Func callback) where T : IResource { diff --git a/src/Aspire.Hosting/Ats/LoggingExports.cs b/src/Aspire.Hosting/Ats/LoggingExports.cs index a724417da85..e8cbf157e8f 100644 --- a/src/Aspire.Hosting/Ats/LoggingExports.cs +++ b/src/Aspire.Hosting/Ats/LoggingExports.cs @@ -17,7 +17,7 @@ internal static class LoggingExports /// /// The service provider handle. /// A logger factory handle. - [AspireExport("getLoggerFactory", Description = "Gets the logger factory from the service provider")] + [AspireExport(Description = "Gets the logger factory from the service provider")] public static ILoggerFactory GetLoggerFactory(this IServiceProvider serviceProvider) { ArgumentNullException.ThrowIfNull(serviceProvider); @@ -28,7 +28,7 @@ public static ILoggerFactory GetLoggerFactory(this IServiceProvider serviceProvi /// /// Logs an information message. /// - [AspireExport("logInformation", Description = "Logs an information message")] + [AspireExport(Description = "Logs an information message")] public static void LogInformation(this ILogger logger, string message) { logger.LogInformation("{Message}", message); @@ -37,7 +37,7 @@ public static void LogInformation(this ILogger logger, string message) /// /// Logs a warning message. /// - [AspireExport("logWarning", Description = "Logs a warning message")] + [AspireExport(Description = "Logs a warning message")] public static void LogWarning(this ILogger logger, string message) { logger.LogWarning("{Message}", message); @@ -46,7 +46,7 @@ public static void LogWarning(this ILogger logger, string message) /// /// Logs an error message. /// - [AspireExport("logError", Description = "Logs an error message")] + [AspireExport(Description = "Logs an error message")] public static void LogError(this ILogger logger, string message) { logger.LogError("{Message}", message); @@ -55,7 +55,7 @@ public static void LogError(this ILogger logger, string message) /// /// Logs a debug message. /// - [AspireExport("logDebug", Description = "Logs a debug message")] + [AspireExport(Description = "Logs a debug message")] public static void LogDebug(this ILogger logger, string message) { logger.LogDebug("{Message}", message); @@ -64,7 +64,7 @@ public static void LogDebug(this ILogger logger, string message) /// /// Logs a message with a specified log level. /// - [AspireExport("log", Description = "Logs a message with specified level")] + [AspireExport(Description = "Logs a message with specified level")] public static void Log(this ILogger logger, string level, string message) { logger.Log(ParseLogLevel(level), "{Message}", message); @@ -76,7 +76,7 @@ public static void Log(this ILogger logger, string level, string message) /// The logger factory handle. /// The category name. /// A logger handle. - [AspireExport("createLogger", Description = "Creates a logger for a category")] + [AspireExport(Description = "Creates a logger for a category")] public static ILogger CreateLogger(this ILoggerFactory loggerFactory, string categoryName) { ArgumentNullException.ThrowIfNull(loggerFactory); @@ -90,7 +90,7 @@ public static ILogger CreateLogger(this ILoggerFactory loggerFactory, string cat /// /// The service provider handle. /// A resource logger service handle. - [AspireExport("getResourceLoggerService", Description = "Gets the resource logger service from the service provider")] + [AspireExport(Description = "Gets the resource logger service from the service provider")] public static ResourceLoggerService GetResourceLoggerService(this IServiceProvider serviceProvider) { ArgumentNullException.ThrowIfNull(serviceProvider); @@ -101,7 +101,7 @@ public static ResourceLoggerService GetResourceLoggerService(this IServiceProvid /// /// Completes the log stream for a resource. /// - [AspireExport("completeLog", Description = "Completes the log stream for a resource")] + [AspireExport(Description = "Completes the log stream for a resource")] public static void CompleteLog(this ResourceLoggerService loggerService, IResourceBuilder resource) { loggerService.Complete(resource.Resource); @@ -110,7 +110,7 @@ public static void CompleteLog(this ResourceLoggerService loggerService, IResour /// /// Completes the log stream by resource name. /// - [AspireExport("completeLogByName", Description = "Completes the log stream by resource name")] + [AspireExport(Description = "Completes the log stream by resource name")] public static void CompleteLogByName(this ResourceLoggerService loggerService, string resourceName) { loggerService.Complete(resourceName); diff --git a/src/Aspire.Hosting/Ats/ModelExports.cs b/src/Aspire.Hosting/Ats/ModelExports.cs index b68e03da1c6..d04f74a03d0 100644 --- a/src/Aspire.Hosting/Ats/ModelExports.cs +++ b/src/Aspire.Hosting/Ats/ModelExports.cs @@ -16,7 +16,7 @@ internal static class ModelExports /// /// The service provider handle. /// The distributed application model handle. - [AspireExport("getDistributedApplicationModel", Description = "Gets the distributed application model from the service provider")] + [AspireExport(Description = "Gets the distributed application model from the service provider")] public static DistributedApplicationModel GetDistributedApplicationModel(this IServiceProvider serviceProvider) { ArgumentNullException.ThrowIfNull(serviceProvider); @@ -29,7 +29,7 @@ public static DistributedApplicationModel GetDistributedApplicationModel(this IS /// /// The distributed application model handle. /// The resources in the model. - [AspireExport("getResources", Description = "Gets resources from the distributed application model")] + [AspireExport(Description = "Gets resources from the distributed application model")] public static IResource[] GetResources(this DistributedApplicationModel model) { ArgumentNullException.ThrowIfNull(model); @@ -43,7 +43,7 @@ public static IResource[] GetResources(this DistributedApplicationModel model) /// The distributed application model handle. /// The resource name. /// The matching resource, or when not found. - [AspireExport("findResourceByName", Description = "Finds a resource by name")] + [AspireExport(Description = "Finds a resource by name")] public static IResource? FindResourceByName(this DistributedApplicationModel model, string name) { ArgumentNullException.ThrowIfNull(model); diff --git a/src/Aspire.Hosting/Ats/NotificationExports.cs b/src/Aspire.Hosting/Ats/NotificationExports.cs index eedcd49134b..b48dea9b211 100644 --- a/src/Aspire.Hosting/Ats/NotificationExports.cs +++ b/src/Aspire.Hosting/Ats/NotificationExports.cs @@ -16,7 +16,7 @@ internal static class NotificationExports /// /// The service provider handle. /// A resource notification service handle. - [AspireExport("getResourceNotificationService", Description = "Gets the resource notification service from the service provider")] + [AspireExport(Description = "Gets the resource notification service from the service provider")] public static ResourceNotificationService GetResourceNotificationService(this IServiceProvider serviceProvider) { ArgumentNullException.ThrowIfNull(serviceProvider); @@ -27,7 +27,7 @@ public static ResourceNotificationService GetResourceNotificationService(this IS /// /// Waits for a resource to reach a specified state. /// - [AspireExport("waitForResourceState", Description = "Waits for a resource to reach a specified state")] + [AspireExport(Description = "Waits for a resource to reach a specified state")] public static Task WaitForResourceState( this ResourceNotificationService notificationService, string resourceName, @@ -39,7 +39,7 @@ public static Task WaitForResourceState( /// /// Waits for a resource to reach one of the specified states. /// - [AspireExport("waitForResourceStates", Description = "Waits for a resource to reach one of the specified states")] + [AspireExport(Description = "Waits for a resource to reach one of the specified states")] public static Task WaitForResourceStates( this ResourceNotificationService notificationService, string resourceName, @@ -51,7 +51,7 @@ public static Task WaitForResourceStates( /// /// Waits for a resource to become healthy. /// - [AspireExport("waitForResourceHealthy", Description = "Waits for a resource to become healthy")] + [AspireExport(Description = "Waits for a resource to become healthy")] public static async Task WaitForResourceHealthy( this ResourceNotificationService notificationService, string resourceName) @@ -63,7 +63,7 @@ public static async Task WaitForResourceHealthy( /// /// Waits for all dependencies of a resource to be ready. /// - [AspireExport("waitForDependencies", Description = "Waits for all dependencies of a resource to be ready")] + [AspireExport(Description = "Waits for all dependencies of a resource to be ready")] public static Task WaitForDependencies( this ResourceNotificationService notificationService, IResourceBuilder resource) @@ -74,7 +74,7 @@ public static Task WaitForDependencies( /// /// Tries to get the current state of a resource. /// - [AspireExport("tryGetResourceState", Description = "Tries to get the current state of a resource")] + [AspireExport(Description = "Tries to get the current state of a resource")] public static ResourceEventDto? TryGetResourceState( this ResourceNotificationService notificationService, string resourceName) @@ -89,7 +89,7 @@ public static Task WaitForDependencies( /// /// Publishes an update for a resource's state. /// - [AspireExport("publishResourceUpdate", Description = "Publishes an update for a resource's state")] + [AspireExport(Description = "Publishes an update for a resource's state")] public static Task PublishResourceUpdate( this ResourceNotificationService notificationService, IResourceBuilder resource, diff --git a/src/Aspire.Hosting/Ats/PipelineExports.cs b/src/Aspire.Hosting/Ats/PipelineExports.cs index 354102783c7..16453357cac 100644 --- a/src/Aspire.Hosting/Ats/PipelineExports.cs +++ b/src/Aspire.Hosting/Ats/PipelineExports.cs @@ -19,7 +19,7 @@ internal static class PipelineExports /// The pipeline summary handle. /// The key or label for the item. /// The Markdown-formatted value for the item. - [AspireExport("addMarkdown", Description = "Adds a Markdown-formatted value to the pipeline summary")] + [AspireExport(Description = "Adds a Markdown-formatted value to the pipeline summary")] public static void AddMarkdown(this PipelineSummary summary, string key, string markdownString) { ArgumentNullException.ThrowIfNull(summary); @@ -32,7 +32,7 @@ public static void AddMarkdown(this PipelineSummary summary, string key, string /// /// Creates a reporting task with plain-text status text. /// - [AspireExport("createTask", Description = "Creates a reporting task with plain-text status text")] + [AspireExport(Description = "Creates a reporting task with plain-text status text")] public static Task CreateTask(this IReportingStep reportingStep, string statusText, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reportingStep); @@ -44,7 +44,7 @@ public static Task CreateTask(this IReportingStep reportingStep, /// /// Creates a reporting task with Markdown-formatted status text. /// - [AspireExport("createMarkdownTask", Description = "Creates a reporting task with Markdown-formatted status text")] + [AspireExport(Description = "Creates a reporting task with Markdown-formatted status text")] public static Task CreateMarkdownTask(this IReportingStep reportingStep, string markdownString, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reportingStep); @@ -56,7 +56,7 @@ public static Task CreateMarkdownTask(this IReportingStep report /// /// Logs a plain-text message for the reporting step. /// - [AspireExport("logStep", Description = "Logs a plain-text message for the reporting step")] + [AspireExport(Description = "Logs a plain-text message for the reporting step")] public static void LogStep(this IReportingStep reportingStep, string level, string message) { ArgumentNullException.ThrowIfNull(reportingStep); @@ -69,7 +69,7 @@ public static void LogStep(this IReportingStep reportingStep, string level, stri /// /// Logs a Markdown-formatted message for the reporting step. /// - [AspireExport("logStepMarkdown", Description = "Logs a Markdown-formatted message for the reporting step")] + [AspireExport(Description = "Logs a Markdown-formatted message for the reporting step")] public static void LogStepMarkdown(this IReportingStep reportingStep, string level, string markdownString) { ArgumentNullException.ThrowIfNull(reportingStep); @@ -82,7 +82,7 @@ public static void LogStepMarkdown(this IReportingStep reportingStep, string lev /// /// Completes the reporting step with plain-text completion text. /// - [AspireExport("completeStep", Description = "Completes the reporting step with plain-text completion text")] + [AspireExport(Description = "Completes the reporting step with plain-text completion text")] public static Task CompleteStep(this IReportingStep reportingStep, string completionText, string completionState = "completed", CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reportingStep); @@ -94,7 +94,7 @@ public static Task CompleteStep(this IReportingStep reportingStep, string comple /// /// Completes the reporting step with Markdown-formatted completion text. /// - [AspireExport("completeStepMarkdown", Description = "Completes the reporting step with Markdown-formatted completion text")] + [AspireExport(Description = "Completes the reporting step with Markdown-formatted completion text")] public static Task CompleteStepMarkdown(this IReportingStep reportingStep, string markdownString, string completionState = "completed", CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reportingStep); @@ -106,7 +106,7 @@ public static Task CompleteStepMarkdown(this IReportingStep reportingStep, strin /// /// Updates the reporting task with plain-text status text. /// - [AspireExport("updateTask", Description = "Updates the reporting task with plain-text status text")] + [AspireExport(Description = "Updates the reporting task with plain-text status text")] public static Task UpdateTask(this IReportingTask reportingTask, string statusText, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reportingTask); @@ -118,7 +118,7 @@ public static Task UpdateTask(this IReportingTask reportingTask, string statusTe /// /// Updates the reporting task with Markdown-formatted status text. /// - [AspireExport("updateTaskMarkdown", Description = "Updates the reporting task with Markdown-formatted status text")] + [AspireExport(Description = "Updates the reporting task with Markdown-formatted status text")] public static Task UpdateTaskMarkdown(this IReportingTask reportingTask, string markdownString, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reportingTask); @@ -130,7 +130,7 @@ public static Task UpdateTaskMarkdown(this IReportingTask reportingTask, string /// /// Completes the reporting task with plain-text completion text. /// - [AspireExport("completeTask", Description = "Completes the reporting task with plain-text completion text")] + [AspireExport(Description = "Completes the reporting task with plain-text completion text")] public static Task CompleteTask(this IReportingTask reportingTask, string? completionMessage = null, string completionState = "completed", CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reportingTask); @@ -141,7 +141,7 @@ public static Task CompleteTask(this IReportingTask reportingTask, string? compl /// /// Completes the reporting task with Markdown-formatted completion text. /// - [AspireExport("completeTaskMarkdown", Description = "Completes the reporting task with Markdown-formatted completion text")] + [AspireExport(Description = "Completes the reporting task with Markdown-formatted completion text")] public static Task CompleteTaskMarkdown(this IReportingTask reportingTask, string markdownString, string completionState = "completed", CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(reportingTask); diff --git a/src/Aspire.Hosting/Ats/UserSecretsExports.cs b/src/Aspire.Hosting/Ats/UserSecretsExports.cs index a09a81100bb..866eef8dfb4 100644 --- a/src/Aspire.Hosting/Ats/UserSecretsExports.cs +++ b/src/Aspire.Hosting/Ats/UserSecretsExports.cs @@ -19,7 +19,7 @@ internal static class UserSecretsExports /// /// The service provider handle. /// A user secrets manager handle. - [AspireExport("getUserSecretsManager", Description = "Gets the user secrets manager from the service provider")] + [AspireExport(Description = "Gets the user secrets manager from the service provider")] public static IUserSecretsManager GetUserSecretsManager(this IServiceProvider serviceProvider) { ArgumentNullException.ThrowIfNull(serviceProvider); @@ -34,7 +34,7 @@ public static IUserSecretsManager GetUserSecretsManager(this IServiceProvider se /// The JSON object payload to persist. /// The cancellation token. /// A task that completes when the state is saved. - [AspireExport("saveStateJson", Description = "Saves state to user secrets from a JSON string")] + [AspireExport(Description = "Saves state to user secrets from a JSON string")] public static Task SaveStateJson(this IUserSecretsManager userSecretsManager, string json, CancellationToken cancellationToken = default) { ArgumentNullException.ThrowIfNull(userSecretsManager); @@ -53,7 +53,7 @@ public static Task SaveStateJson(this IUserSecretsManager userSecretsManager, st /// A resource builder from the target application. /// The secret name. /// The value to persist when the secret is missing. - [AspireExport("getOrSetSecret", Description = "Gets a secret value if it exists, or sets it to the provided value if it does not")] + [AspireExport(Description = "Gets a secret value if it exists, or sets it to the provided value if it does not")] public static void GetOrSetSecret(this IUserSecretsManager userSecretsManager, IResourceBuilder resourceBuilder, string name, string value) where T : IResource { diff --git a/src/Aspire.Hosting/ContainerRegistryResourceBuilderExtensions.cs b/src/Aspire.Hosting/ContainerRegistryResourceBuilderExtensions.cs index 360a4a147ee..2d501fce9a2 100644 --- a/src/Aspire.Hosting/ContainerRegistryResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting/ContainerRegistryResourceBuilderExtensions.cs @@ -35,7 +35,7 @@ public static class ContainerRegistryResourceBuilderExtensions /// /// [Experimental("ASPIRECOMPUTE003", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] - [AspireExport("addContainerRegistry", Description = "Adds a container registry resource")] + [AspireExport(Description = "Adds a container registry resource")] public static IResourceBuilder AddContainerRegistry( this IDistributedApplicationBuilder builder, [ResourceName] string name, @@ -153,7 +153,7 @@ private static void SubscribeToAddRegistryTargetAnnotations(IDistributedApplicat /// /// [Experimental("ASPIRECOMPUTE003", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] - [AspireExport("withContainerRegistry", Description = "Configures a resource to use a container registry")] + [AspireExport(Description = "Configures a resource to use a container registry")] public static IResourceBuilder WithContainerRegistry( this IResourceBuilder builder, IResourceBuilder registry) diff --git a/src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs b/src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs index d97965c4419..fa808b2e85d 100644 --- a/src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting/ContainerResourceBuilderExtensions.cs @@ -90,7 +90,7 @@ await containerImageBuilder.BuildImageAsync( /// The name of the resource. /// The container image name. The tag is assumed to be "latest". /// The for chaining. - [AspireExport("addContainer", Description = "Adds a container resource")] + [AspireExport(Description = "Adds a container resource")] public static IResourceBuilder AddContainer(this IDistributedApplicationBuilder builder, [ResourceName] string name, string image) { ArgumentNullException.ThrowIfNull(builder); @@ -250,7 +250,7 @@ public static IResourceBuilder WithVolume(this IResourceBuilder builder /// /// /// - [AspireExport("withBindMount", Description = "Adds a bind mount")] + [AspireExport(Description = "Adds a bind mount")] public static IResourceBuilder WithBindMount(this IResourceBuilder builder, string source, string target, bool isReadOnly = false) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -270,7 +270,7 @@ public static IResourceBuilder WithBindMount(this IResourceBuilder buil /// The resource builder. /// The new entrypoint for the container. /// The . - [AspireExport("withEntrypoint", Description = "Sets the container entrypoint")] + [AspireExport(Description = "Sets the container entrypoint")] public static IResourceBuilder WithEntrypoint(this IResourceBuilder builder, string entrypoint) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -287,7 +287,7 @@ public static IResourceBuilder WithEntrypoint(this IResourceBuilder bui /// Builder for the container resource. /// Tag value. /// The . - [AspireExport("withImageTag", Description = "Sets the container image tag")] + [AspireExport(Description = "Sets the container image tag")] public static IResourceBuilder WithImageTag(this IResourceBuilder builder, string tag) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -318,7 +318,7 @@ public static IResourceBuilder WithImageTag(this IResourceBuilder build /// Builder for the container resource. /// Registry value. /// The . - [AspireExport("withImageRegistry", Description = "Sets the container image registry")] + [AspireExport(Description = "Sets the container image registry")] public static IResourceBuilder WithImageRegistry(this IResourceBuilder builder, string? registry) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -340,7 +340,7 @@ public static IResourceBuilder WithImageRegistry(this IResourceBuilder /// Image value. /// Tag value. /// The . - [AspireExport("withImage", Description = "Sets the container image")] + [AspireExport(Description = "Sets the container image")] public static IResourceBuilder WithImage(this IResourceBuilder builder, string image, string? tag = null) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -407,7 +407,7 @@ public static IResourceBuilder WithImage(this IResourceBuilder builder, /// Builder for the container resource. /// Registry value. /// The . - [AspireExport("withImageSHA256", Description = "Sets the image SHA256 digest")] + [AspireExport(Description = "Sets the image SHA256 digest")] public static IResourceBuilder WithImageSHA256(this IResourceBuilder builder, string sha256) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -432,7 +432,7 @@ public static IResourceBuilder WithImageSHA256(this IResourceBuilder bu /// Builder for the container resource. /// The arguments to be passed to the container runtime run command when the container resource is started. /// The . - [AspireExport("withContainerRuntimeArgs", Description = "Adds runtime arguments for the container")] + [AspireExport(Description = "Adds runtime arguments for the container")] public static IResourceBuilder WithContainerRuntimeArgs(this IResourceBuilder builder, params string[] args) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -505,7 +505,7 @@ public static IResourceBuilder WithContainerRuntimeArgs(this IResourceBuil /// /// /// - [AspireExport("withLifetime", Description = "Sets the lifetime behavior of the container resource")] + [AspireExport(Description = "Sets the lifetime behavior of the container resource")] public static IResourceBuilder WithLifetime(this IResourceBuilder builder, ContainerLifetime lifetime) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -520,7 +520,7 @@ public static IResourceBuilder WithLifetime(this IResourceBuilder build /// Builder for the container resource. /// The pull policy behavior for the container resource. /// The . - [AspireExport("withImagePullPolicy", Description = "Sets the container image pull policy")] + [AspireExport(Description = "Sets the container image pull policy")] public static IResourceBuilder WithImagePullPolicy(this IResourceBuilder builder, ImagePullPolicy pullPolicy) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -537,7 +537,7 @@ private static IResourceBuilder ThrowResourceIsNotContainer(IResourceBuild /// /// Resource builder. /// The . - [AspireExport("publishAsContainer", Description = "Configures the resource to be published as a container")] + [AspireExport(Description = "Configures the resource to be published as a container")] public static IResourceBuilder PublishAsContainer(this IResourceBuilder builder) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -582,7 +582,7 @@ public static IResourceBuilder PublishAsContainer(this IResourceBuilder /// /// /// - [AspireExport("withDockerfile", Description = "Configures the resource to use a Dockerfile")] + [AspireExport(Description = "Configures the resource to use a Dockerfile")] public static IResourceBuilder WithDockerfile(this IResourceBuilder builder, string contextPath, string? dockerfilePath = null, string? stage = null) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -816,7 +816,7 @@ public static IResourceBuilder WithDockerfileFactory(this IResourceBuilder /// /// /// - [AspireExport("addDockerfile", Description = "Adds a container resource built from a Dockerfile")] + [AspireExport(Description = "Adds a container resource built from a Dockerfile")] public static IResourceBuilder AddDockerfile(this IDistributedApplicationBuilder builder, [ResourceName] string name, string contextPath, string? dockerfilePath = null, string? stage = null) { ArgumentNullException.ThrowIfNull(builder); @@ -999,7 +999,7 @@ public static IResourceBuilder AddDockerfileBuilder(this IDis /// The resource builder for the container resource. /// The desired container name. Must be a valid container name or your runtime will report an error. /// The . - [AspireExport("withContainerName", Description = "Sets the container name")] + [AspireExport(Description = "Sets the container name")] public static IResourceBuilder WithContainerName(this IResourceBuilder builder, string name) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -1382,7 +1382,7 @@ public static IResourceBuilder WithContainerFiles(this IResourceBuilder /// The user needs to be careful to ensure that container endpoints are using unique ports when disabling proxy support as by default for proxy-less /// endpoints, Aspire will allocate the internal container port as the host port, which will increase the chance of port conflicts. /// - [AspireExport("withEndpointProxySupport", Description = "Configures endpoint proxy support")] + [AspireExport(Description = "Configures endpoint proxy support")] public static IResourceBuilder WithEndpointProxySupport(this IResourceBuilder builder, bool proxyEnabled) where T : ContainerResource { ArgumentNullException.ThrowIfNull(builder); @@ -1576,7 +1576,7 @@ public static IResourceBuilder WithDockerfileBuilder(this IResourceBuilder /// /// /// - [AspireExport("withDockerfileBaseImage", Description = "Sets the base image for a Dockerfile build")] + [AspireExport(Description = "Sets the base image for a Dockerfile build")] [Experimental("ASPIREDOCKERFILEBUILDER001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] public static IResourceBuilder WithDockerfileBaseImage(this IResourceBuilder builder, string? buildImage = null, string? runtimeImage = null) where T : IResource { @@ -1611,7 +1611,7 @@ public static IResourceBuilder WithDockerfileBaseImage(this IResourceBuild /// Multiple aliases can be added by calling this method multiple times. /// /// - [AspireExport("withContainerNetworkAlias", Description = "Adds a network alias for the container")] + [AspireExport(Description = "Adds a network alias for the container")] public static IResourceBuilder WithContainerNetworkAlias(this IResourceBuilder builder, string alias) where T : ContainerResource { return builder.WithAnnotation(new ContainerNetworkAliasAnnotation(alias) { Network = KnownNetworkIdentifiers.DefaultAspireContainerNetwork }); diff --git a/src/Aspire.Hosting/DistributedApplication.cs b/src/Aspire.Hosting/DistributedApplication.cs index 2ebb6e0dc54..1ffadab86b1 100644 --- a/src/Aspire.Hosting/DistributedApplication.cs +++ b/src/Aspire.Hosting/DistributedApplication.cs @@ -150,7 +150,7 @@ public DistributedApplication(IHost host) /// /// /// - [AspireExport("createBuilder", Description = "Creates a new distributed application builder")] + [AspireExport(Description = "Creates a new distributed application builder")] public static IDistributedApplicationBuilder CreateBuilder(string[] args) { WaitForDebugger(); diff --git a/src/Aspire.Hosting/DotnetToolResourceExtensions.cs b/src/Aspire.Hosting/DotnetToolResourceExtensions.cs index e7bec44432c..050bd4f0b7a 100644 --- a/src/Aspire.Hosting/DotnetToolResourceExtensions.cs +++ b/src/Aspire.Hosting/DotnetToolResourceExtensions.cs @@ -24,7 +24,7 @@ public static class DotnetToolResourceExtensions /// The name of the resource. /// The package id of the tool. /// The . - [AspireExport("addDotnetTool", Description = "Adds a .NET tool resource")] + [AspireExport(Description = "Adds a .NET tool resource")] public static IResourceBuilder AddDotnetTool(this IDistributedApplicationBuilder builder, [ResourceName] string name, string packageId) => builder.AddDotnetTool(new DotnetToolResource(name, packageId)); @@ -122,7 +122,7 @@ await rns.PublishUpdateAsync(resource, x => x with /// The . /// The package identifier to assign to the tool configuration. Cannot be null. /// The for chaining. - [AspireExport("withToolPackage", Description = "Sets the tool package ID")] + [AspireExport(Description = "Sets the tool package ID")] public static IResourceBuilder WithToolPackage(this IResourceBuilder builder, string packageId) where T : DotnetToolResource { @@ -137,7 +137,7 @@ public static IResourceBuilder WithToolPackage(this IResourceBuilder bu /// The . /// The package version to use /// The for chaining. - [AspireExport("withToolVersion", Description = "Sets the tool version")] + [AspireExport(Description = "Sets the tool version")] public static IResourceBuilder WithToolVersion(this IResourceBuilder builder, string version) where T : DotnetToolResource { @@ -151,7 +151,7 @@ public static IResourceBuilder WithToolVersion(this IResourceBuilder bu /// The type of resource being built. Must inherit from DotnetToolResource. /// The . /// The for chaining. - [AspireExport("withToolPrerelease", Description = "Allows prerelease tool versions")] + [AspireExport(Description = "Allows prerelease tool versions")] public static IResourceBuilder WithToolPrerelease(this IResourceBuilder builder) where T : DotnetToolResource { @@ -166,7 +166,7 @@ public static IResourceBuilder WithToolPrerelease(this IResourceBuilder /// The . /// The source to add. /// The for chaining. - [AspireExport("withToolSource", Description = "Adds a NuGet source for the tool")] + [AspireExport(Description = "Adds a NuGet source for the tool")] public static IResourceBuilder WithToolSource(this IResourceBuilder builder, string source) where T : DotnetToolResource { @@ -180,7 +180,7 @@ public static IResourceBuilder WithToolSource(this IResourceBuilder bui /// The Dotnet Tool resource type /// The . /// The for chaining. - [AspireExport("withToolIgnoreExistingFeeds", Description = "Ignores existing NuGet feeds")] + [AspireExport(Description = "Ignores existing NuGet feeds")] public static IResourceBuilder WithToolIgnoreExistingFeeds(this IResourceBuilder builder) where T : DotnetToolResource { @@ -194,7 +194,7 @@ public static IResourceBuilder WithToolIgnoreExistingFeeds(this IResourceB /// The Dotnet Tool resource type /// The . /// The for chaining. - [AspireExport("withToolIgnoreFailedSources", Description = "Ignores failed NuGet sources")] + [AspireExport(Description = "Ignores failed NuGet sources")] public static IResourceBuilder WithToolIgnoreFailedSources(this IResourceBuilder builder) where T : DotnetToolResource { diff --git a/src/Aspire.Hosting/ExecutableResourceBuilderExtensions.cs b/src/Aspire.Hosting/ExecutableResourceBuilderExtensions.cs index 8a87eda8c17..fc7befa7ddd 100644 --- a/src/Aspire.Hosting/ExecutableResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting/ExecutableResourceBuilderExtensions.cs @@ -26,7 +26,7 @@ public static class ExecutableResourceBuilderExtensions /// /// To run an executable file that's in the current directory, specify the full path or use the relative path ./ to represent the current directory. /// - [AspireExport("addExecutable", Description = "Adds an executable resource")] + [AspireExport(Description = "Adds an executable resource")] public static IResourceBuilder AddExecutable(this IDistributedApplicationBuilder builder, [ResourceName] string name, string command, string workingDirectory, params string[]? args) { ArgumentNullException.ThrowIfNull(builder); @@ -74,7 +74,7 @@ public static IResourceBuilder AddExecutable(this IDistribut /// Type of executable resource /// Resource builder /// A reference to the . - [AspireExport("publishAsDockerFile", Description = "Publishes the executable as a Docker container")] + [AspireExport(Description = "Publishes the executable as a Docker container")] public static IResourceBuilder PublishAsDockerFile(this IResourceBuilder builder) where T : ExecutableResource { return builder.PublishAsDockerFile(c => { }); @@ -203,7 +203,7 @@ public static IResourceBuilder WithCommand(this IResourceBuilder builde /// Builder for the executable resource. /// Working directory. /// The . - [AspireExport("withWorkingDirectory", Description = "Sets the executable working directory")] + [AspireExport(Description = "Sets the executable working directory")] public static IResourceBuilder WithWorkingDirectory(this IResourceBuilder builder, string workingDirectory) where T : ExecutableResource { ArgumentNullException.ThrowIfNull(workingDirectory); diff --git a/src/Aspire.Hosting/ExternalServiceBuilderExtensions.cs b/src/Aspire.Hosting/ExternalServiceBuilderExtensions.cs index f0789ce4393..7bf9d7c41a2 100644 --- a/src/Aspire.Hosting/ExternalServiceBuilderExtensions.cs +++ b/src/Aspire.Hosting/ExternalServiceBuilderExtensions.cs @@ -24,7 +24,7 @@ public static class ExternalServiceBuilderExtensions /// The name of the resource. /// The URL of the external service. /// An instance. - [AspireExport("addExternalService", Description = "Adds an external service resource")] + [AspireExport(Description = "Adds an external service resource")] public static IResourceBuilder AddExternalService(this IDistributedApplicationBuilder builder, [ResourceName] string name, string url) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting/IDistributedApplicationBuilder.cs b/src/Aspire.Hosting/IDistributedApplicationBuilder.cs index 242c67b9561..414e6c3a626 100644 --- a/src/Aspire.Hosting/IDistributedApplicationBuilder.cs +++ b/src/Aspire.Hosting/IDistributedApplicationBuilder.cs @@ -269,6 +269,6 @@ public interface IDistributedApplicationBuilder /// when the process exists. /// /// - [AspireExport("build", Description = "Builds the distributed application")] + [AspireExport(Description = "Builds the distributed application")] DistributedApplication Build(); } diff --git a/src/Aspire.Hosting/McpServerResourceBuilderExtensions.cs b/src/Aspire.Hosting/McpServerResourceBuilderExtensions.cs index edd9b07d197..a73700781c0 100644 --- a/src/Aspire.Hosting/McpServerResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting/McpServerResourceBuilderExtensions.cs @@ -38,7 +38,7 @@ public static class McpServerResourceBuilderExtensions /// /// [Experimental("ASPIREMCP001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] - [AspireExport("withMcpServer", Description = "Configures an MCP server endpoint on the resource")] + [AspireExport(Description = "Configures an MCP server endpoint on the resource")] public static IResourceBuilder WithMcpServer( this IResourceBuilder builder, string? path = "/mcp", diff --git a/src/Aspire.Hosting/OtlpConfigurationExtensions.cs b/src/Aspire.Hosting/OtlpConfigurationExtensions.cs index 3ef73053e39..72b1fc98978 100644 --- a/src/Aspire.Hosting/OtlpConfigurationExtensions.cs +++ b/src/Aspire.Hosting/OtlpConfigurationExtensions.cs @@ -117,7 +117,7 @@ private static void RegisterOtlpEnvironment(IResource resource, IConfiguration c /// The resource type. /// The resource builder. /// The . - [AspireExport("withOtlpExporter", Description = "Configures OTLP telemetry export")] + [AspireExport(Description = "Configures OTLP telemetry export")] public static IResourceBuilder WithOtlpExporter(this IResourceBuilder builder) where T : IResourceWithEnvironment { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting/ParameterResourceBuilderExtensions.cs b/src/Aspire.Hosting/ParameterResourceBuilderExtensions.cs index 7242b6aabac..7e59e076c34 100644 --- a/src/Aspire.Hosting/ParameterResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting/ParameterResourceBuilderExtensions.cs @@ -23,7 +23,7 @@ public static class ParameterResourceBuilderExtensions /// Optional flag indicating whether the parameter should be regarded as secret. /// Resource builder for the parameter. /// - [AspireExport("addParameter", Description = "Adds a parameter resource")] + [AspireExport(Description = "Adds a parameter resource")] public static IResourceBuilder AddParameter(this IDistributedApplicationBuilder builder, [ResourceName] string name, bool secret = false) { ArgumentNullException.ThrowIfNull(builder); @@ -108,7 +108,7 @@ public static IResourceBuilder AddParameter(this IDistributed /// Configuration key used to get the value of the parameter /// Optional flag indicating whether the parameter should be regarded as secret. /// Resource builder for the parameter. - [AspireExport("addParameterFromConfiguration", Description = "Adds a parameter sourced from configuration")] + [AspireExport(Description = "Adds a parameter sourced from configuration")] public static IResourceBuilder AddParameterFromConfiguration(this IDistributedApplicationBuilder builder, string name, string configurationKey, bool secret = false) { ArgumentNullException.ThrowIfNull(builder); @@ -170,7 +170,7 @@ public static IResourceBuilder AddParameter(this IDistributed /// true allows the description to contain Markdown elements such as links, text decoration and lists. /// /// Resource builder for the parameter. - [AspireExport("withDescription", Description = "Sets a parameter description")] + [AspireExport(Description = "Sets a parameter description")] public static IResourceBuilder WithDescription(this IResourceBuilder builder, string description, bool enableMarkdown = false) { ArgumentNullException.ThrowIfNull(builder); @@ -252,7 +252,7 @@ internal static IResourceBuilder AddParameter(this IDistributedApplication /// Environment variable name to set when WithReference is used. /// Resource builder for the parameter. /// - [AspireExport("addConnectionString", Description = "Adds a connection string resource")] + [AspireExport(Description = "Adds a connection string resource")] public static IResourceBuilder AddConnectionString(this IDistributedApplicationBuilder builder, [ResourceName] string name, string? environmentVariableName = null) { ArgumentNullException.ThrowIfNull(builder); @@ -273,7 +273,7 @@ public static IResourceBuilder AddConnectionStrin /// The resource type. /// The resource builder. /// The configured . - [AspireExport("publishAsConnectionString", Description = "Publishes the resource as a connection string")] + [AspireExport(Description = "Publishes the resource as a connection string")] public static IResourceBuilder PublishAsConnectionString(this IResourceBuilder builder) where T : ContainerResource, IResourceWithConnectionString { diff --git a/src/Aspire.Hosting/Pipelines/PipelineStep.cs b/src/Aspire.Hosting/Pipelines/PipelineStep.cs index 7cd6ab2b744..20cf9d0d488 100644 --- a/src/Aspire.Hosting/Pipelines/PipelineStep.cs +++ b/src/Aspire.Hosting/Pipelines/PipelineStep.cs @@ -61,7 +61,7 @@ public class PipelineStep /// Adds a dependency on another step. /// /// The name of the step to depend on. - [AspireExport("dependsOn", Description = "Adds a dependency on another step by name")] + [AspireExport(Description = "Adds a dependency on another step by name")] public void DependsOn(string stepName) { DependsOnSteps.Add(stepName); @@ -81,7 +81,7 @@ public void DependsOn(PipelineStep step) /// This creates the inverse relationship where the other step will depend on this step. /// /// The name of the step that requires this step. - [AspireExport("requiredBy", Description = "Specifies that another step requires this step by name")] + [AspireExport(Description = "Specifies that another step requires this step by name")] public void RequiredBy(string stepName) { RequiredBySteps.Add(stepName); diff --git a/src/Aspire.Hosting/Pipelines/PipelineStepFactoryExtensions.cs b/src/Aspire.Hosting/Pipelines/PipelineStepFactoryExtensions.cs index 231244a8c1e..6364502f4eb 100644 --- a/src/Aspire.Hosting/Pipelines/PipelineStepFactoryExtensions.cs +++ b/src/Aspire.Hosting/Pipelines/PipelineStepFactoryExtensions.cs @@ -100,7 +100,7 @@ public static IResourceBuilder WithPipelineStepFactory( /// Optional tags that categorize this step. /// An optional human-readable description of the step. /// The resource builder for chaining. - [AspireExport("withPipelineStepFactory", Description = "Adds a pipeline step to the resource")] + [AspireExport(Description = "Adds a pipeline step to the resource")] public static IResourceBuilder WithPipelineStepFactory( this IResourceBuilder builder, string stepName, @@ -153,7 +153,7 @@ public static IResourceBuilder WithPipelineConfiguration( /// The resource builder. /// The callback function to execute during the configuration phase. /// The resource builder for chaining. - [AspireExport("withPipelineConfiguration", Description = "Configures pipeline step dependencies via a callback")] + [AspireExport(Description = "Configures pipeline step dependencies via a callback")] public static IResourceBuilder WithPipelineConfiguration( this IResourceBuilder builder, Action callback) where T : IResource diff --git a/src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs b/src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs index 3b5577ad18a..6d7e919e53e 100644 --- a/src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting/ProjectResourceBuilderExtensions.cs @@ -187,7 +187,7 @@ public static IResourceBuilder AddProject(this IDistributedAppl /// /// /// - [AspireExport("addProject", Description = "Adds a .NET project resource")] + [AspireExport(Description = "Adds a .NET project resource")] public static IResourceBuilder AddProject(this IDistributedApplicationBuilder builder, [ResourceName] string name, string projectPath, string? launchProfileName) { ArgumentNullException.ThrowIfNull(builder); @@ -328,7 +328,7 @@ public static IResourceBuilder AddProject(this IDistributedAppl /// /// [Experimental("ASPIRECSHARPAPPS001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] - [AspireExport("addCSharpApp", Description = "Adds a C# application resource")] + [AspireExport(Description = "Adds a C# application resource")] public static IResourceBuilder AddCSharpApp(this IDistributedApplicationBuilder builder, string name, string path) { ArgumentNullException.ThrowIfNull(builder); @@ -748,7 +748,7 @@ EndpointAnnotation GetOrCreateEndpointForScheme(string scheme) /// /// /// - [AspireExport("withReplicas", Description = "Sets the number of replicas")] + [AspireExport(Description = "Sets the number of replicas")] public static IResourceBuilder WithReplicas(this IResourceBuilder builder, int replicas) { ArgumentNullException.ThrowIfNull(builder); @@ -783,7 +783,7 @@ public static IResourceBuilder WithReplicas(this IResourceBuild /// /// /// - [AspireExport("disableForwardedHeaders", Description = "Disables forwarded headers for the project")] + [AspireExport(Description = "Disables forwarded headers for the project")] public static IResourceBuilder DisableForwardedHeaders(this IResourceBuilder builder) { ArgumentNullException.ThrowIfNull(builder); diff --git a/src/Aspire.Hosting/RequiredCommandResourceExtensions.cs b/src/Aspire.Hosting/RequiredCommandResourceExtensions.cs index f20b2926cfc..541d76b8c8c 100644 --- a/src/Aspire.Hosting/RequiredCommandResourceExtensions.cs +++ b/src/Aspire.Hosting/RequiredCommandResourceExtensions.cs @@ -25,7 +25,7 @@ public static class RequiredCommandResourceExtensions /// 2. It is discoverable on the current process PATH (respecting PATHEXT on Windows). /// If the command is not found, a warning message will be logged but the resource will be allowed to attempt to start. /// - [AspireExport("withRequiredCommand", Description = "Adds a required command dependency")] + [AspireExport(Description = "Adds a required command dependency")] public static IResourceBuilder WithRequiredCommand( this IResourceBuilder builder, string command, diff --git a/src/Aspire.Hosting/ResourceBuilderExtensions.cs b/src/Aspire.Hosting/ResourceBuilderExtensions.cs index b4a6bf56f27..d6d836910e2 100644 --- a/src/Aspire.Hosting/ResourceBuilderExtensions.cs +++ b/src/Aspire.Hosting/ResourceBuilderExtensions.cs @@ -41,7 +41,7 @@ public static IResourceBuilder WithEnvironment(this IResourceBuilder bu return builder.WithAnnotation(new EnvironmentAnnotation(name, value ?? string.Empty)); } - [AspireExport("withEnvironment", Description = "Sets an environment variable")] + [AspireExport(Description = "Sets an environment variable")] internal static IResourceBuilder WithEnvironment( this IResourceBuilder builder, string name, @@ -469,7 +469,7 @@ public static IResourceBuilder WithEnvironment(this IResourceBuild /// The name of the connection property to annotate. Cannot be null. /// The value of the connection property, specified as a reference expression. /// The same resource builder instance with the connection property annotation applied. - [AspireExport("withConnectionProperty", Description = "Adds a connection property with a reference expression")] + [AspireExport(Description = "Adds a connection property with a reference expression")] public static IResourceBuilder WithConnectionProperty(this IResourceBuilder builder, string name, ReferenceExpression value) where T : IResourceWithConnectionString { ArgumentNullException.ThrowIfNull(builder); @@ -503,7 +503,7 @@ public static IResourceBuilder WithConnectionProperty(this IResourceBuilde /// The resource builder for a resource implementing . /// The arguments to be passed to the resource when it is started. /// The . - [AspireExport("withArgs", Description = "Adds arguments")] + [AspireExport(Description = "Adds arguments")] public static IResourceBuilder WithArgs(this IResourceBuilder builder, params string[] args) where T : IResourceWithArgs { ArgumentNullException.ThrowIfNull(builder); @@ -704,7 +704,7 @@ public static IResourceBuilder WithReferenceEnvironment WithReference( this IResourceBuilder builder, IResourceBuilder source, @@ -916,7 +916,7 @@ private static void SplatConnectionProperties(IResourceWithConnectionString reso /// The resource that provides the connection properties. Cannot be null. /// The key of the connection property to retrieve. Cannot be null. /// The value associated with the specified connection property key. - [AspireExport("getConnectionProperty", Description = "Gets a connection property by key")] + [AspireExport(Description = "Gets a connection property by key")] public static ReferenceExpression GetConnectionProperty(this IResourceWithConnectionString resource, string key) { foreach (var connectionProperty in resource.GetConnectionProperties()) @@ -1263,7 +1263,7 @@ public static IResourceBuilder WithEndpoint(this IResourceBuilder build /// Specifies if the endpoint will be proxied by DCP. Defaults to true. /// The . /// Throws an exception if an endpoint with the same name already exists on the specified resource. - [AspireExport("withEndpoint", Description = "Adds a network endpoint")] + [AspireExport(Description = "Adds a network endpoint")] [System.Diagnostics.CodeAnalysis.SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "")] public static IResourceBuilder WithEndpoint(this IResourceBuilder builder, int? port = null, int? targetPort = null, string? scheme = null, [EndpointName] string? name = null, string? env = null, bool isProxied = true, bool? isExternal = null, ProtocolType? protocol = null) where T : IResourceWithEndpoints { @@ -1339,7 +1339,7 @@ public static IResourceBuilder WithEndpoint(this IResourceBuilder build /// Specifies if the endpoint will be proxied by DCP. Defaults to true. /// The . /// Throws an exception if an endpoint with the same name already exists on the specified resource. - [AspireExport("withHttpEndpoint", Description = "Adds an HTTP endpoint")] + [AspireExport(Description = "Adds an HTTP endpoint")] public static IResourceBuilder WithHttpEndpoint(this IResourceBuilder builder, int? port = null, int? targetPort = null, [EndpointName] string? name = null, string? env = null, bool isProxied = true) where T : IResourceWithEndpoints { ArgumentNullException.ThrowIfNull(builder); @@ -1360,7 +1360,7 @@ public static IResourceBuilder WithHttpEndpoint(this IResourceBuilder b /// Specifies if the endpoint will be proxied by DCP. Defaults to true. /// The . /// Throws an exception if an endpoint with the same name already exists on the specified resource. - [AspireExport("withHttpsEndpoint", Description = "Adds an HTTPS endpoint")] + [AspireExport(Description = "Adds an HTTPS endpoint")] public static IResourceBuilder WithHttpsEndpoint(this IResourceBuilder builder, int? port = null, int? targetPort = null, [EndpointName] string? name = null, string? env = null, bool isProxied = true) where T : IResourceWithEndpoints { ArgumentNullException.ThrowIfNull(builder); @@ -1374,7 +1374,7 @@ public static IResourceBuilder WithHttpsEndpoint(this IResourceBuilder /// The resource type. /// The resource builder. /// The . - [AspireExport("withExternalHttpEndpoints", Description = "Makes HTTP endpoints externally accessible")] + [AspireExport(Description = "Makes HTTP endpoints externally accessible")] public static IResourceBuilder WithExternalHttpEndpoints(this IResourceBuilder builder) where T : IResourceWithEndpoints { ArgumentNullException.ThrowIfNull(builder); @@ -1421,7 +1421,7 @@ public static EndpointReference GetEndpoint(this IResourceBuilder builder, /// The the resource builder. /// The name of the endpoint. /// An that can be used to resolve the address of the endpoint after resource allocation has occurred. - [AspireExport("getEndpoint", Description = "Gets an endpoint reference")] + [AspireExport(Description = "Gets an endpoint reference")] public static EndpointReference GetEndpoint(this IResourceBuilder builder, [EndpointName] string name) where T : IResourceWithEndpoints { ArgumentNullException.ThrowIfNull(builder); @@ -1435,7 +1435,7 @@ public static EndpointReference GetEndpoint(this IResourceBuilder builder, /// The resource type. /// The resource builder. /// The . - [AspireExport("asHttp2Service", Description = "Configures resource for HTTP/2")] + [AspireExport(Description = "Configures resource for HTTP/2")] public static IResourceBuilder AsHttp2Service(this IResourceBuilder builder) where T : IResourceWithEndpoints { ArgumentNullException.ThrowIfNull(builder); @@ -1552,7 +1552,7 @@ public static IResourceBuilder WithUrls(this IResourceBuilder builder, /// .WithUrl("/home", "Home"); /// /// - [AspireExport("withUrl", Description = "Adds or modifies displayed URLs")] + [AspireExport(Description = "Adds or modifies displayed URLs")] public static IResourceBuilder WithUrl(this IResourceBuilder builder, string url, string? displayText = null) where T : IResource { @@ -1672,7 +1672,7 @@ public static IResourceBuilder WithUrl(this IResourceBuilder builder, R /// /// /// - [AspireExport("withUrlForEndpoint", Description = "Customizes the URL for a specific endpoint via callback")] + [AspireExport(Description = "Customizes the URL for a specific endpoint via callback")] public static IResourceBuilder WithUrlForEndpoint(this IResourceBuilder builder, string endpointName, Action callback) where T : IResource { @@ -1777,7 +1777,7 @@ public static IResourceBuilder PublishWithContainerFiles( /// The resource builder to which the container files source annotation will be added. Cannot be null. /// The path to the container files source to associate with the resource. Cannot be null. /// The resource builder instance with the container files source annotation applied. - [AspireExport("withContainerFilesSource", Description = "Sets the source directory for container files")] + [AspireExport(Description = "Sets the source directory for container files")] public static IResourceBuilder WithContainerFilesSource( this IResourceBuilder builder, string sourcePath) where T : IResourceWithContainerFiles @@ -1797,7 +1797,7 @@ public static IResourceBuilder WithContainerFilesSource( /// The type of resource that supports container files and is being built. /// The resource builder to which the container files source annotations should be removed. Cannot be null. /// The resource builder instance with the container files source annotation applied. - [AspireExport("clearContainerFilesSources", Description = "Clears all container file sources")] + [AspireExport(Description = "Clears all container file sources")] public static IResourceBuilder ClearContainerFilesSources( this IResourceBuilder builder) where T : IResourceWithContainerFiles { @@ -1817,7 +1817,7 @@ public static IResourceBuilder ClearContainerFilesSources( /// The resource type. /// The resource to exclude. /// The . - [AspireExport("excludeFromManifest", Description = "Excludes the resource from the deployment manifest")] + [AspireExport(Description = "Excludes the resource from the deployment manifest")] public static IResourceBuilder ExcludeFromManifest(this IResourceBuilder builder) where T : IResource { ArgumentNullException.ThrowIfNull(builder); @@ -2072,7 +2072,7 @@ private static IResourceBuilder WaitForStartCore(this IResourceBuilder /// /// /// - [AspireExport("withExplicitStart", Description = "Prevents resource from starting automatically")] + [AspireExport(Description = "Prevents resource from starting automatically")] public static IResourceBuilder WithExplicitStart(this IResourceBuilder builder) where T : IResource { return builder.WithAnnotation(new ExplicitStartupAnnotation()); @@ -2161,7 +2161,7 @@ public static IResourceBuilder WaitForCompletion(this IResourceBuilder /// /// /// - [AspireExport("withHealthCheck", Description = "Adds a health check by key")] + [AspireExport(Description = "Adds a health check by key")] public static IResourceBuilder WithHealthCheck(this IResourceBuilder builder, string key) where T : IResource { ArgumentNullException.ThrowIfNull(builder); @@ -2206,7 +2206,7 @@ public static IResourceBuilder WithHealthCheck(this IResourceBuilder bu /// /// /// - [AspireExport("withHttpHealthCheck", Description = "Adds an HTTP health check")] + [AspireExport(Description = "Adds an HTTP health check")] public static IResourceBuilder WithHttpHealthCheck(this IResourceBuilder builder, string? path = null, int? statusCode = null, string? endpointName = null) where T : IResourceWithEndpoints { ArgumentNullException.ThrowIfNull(builder); @@ -2358,7 +2358,7 @@ public static IResourceBuilder WithHttpsHealthCheck(this IResourceBuilder< /// and can be executed by a user using the dashboard UI. /// When a command is executed, the callback is called and is run inside the Aspire host. /// - [AspireExport("withCommand", Description = "Adds a resource command")] + [AspireExport(Description = "Adds a resource command")] [OverloadResolutionPriority(1)] public static IResourceBuilder WithCommand( this IResourceBuilder builder, @@ -2769,7 +2769,7 @@ public static IResourceBuilder WithCertificateAuthorityCollection /// /// - [AspireExport("withDeveloperCertificateTrust", Description = "Configures developer certificate trust")] + [AspireExport(Description = "Configures developer certificate trust")] public static IResourceBuilder WithDeveloperCertificateTrust(this IResourceBuilder builder, bool trust) where TResource : IResourceWithEnvironment, IResourceWithArgs { @@ -2818,7 +2818,7 @@ public static IResourceBuilder WithDeveloperCertificateTrust /// /// - [AspireExport("withCertificateTrustScope", Description = "Sets the certificate trust scope")] + [AspireExport(Description = "Sets the certificate trust scope")] public static IResourceBuilder WithCertificateTrustScope(this IResourceBuilder builder, CertificateTrustScope scope) where TResource : IResourceWithEnvironment, IResourceWithArgs { @@ -2961,7 +2961,7 @@ public static IResourceBuilder WithHttpsCertificate(this I /// /// [Experimental("ASPIRECERTIFICATES001", UrlFormat = "https://aka.ms/aspire/diagnostics/{0}")] - [AspireExport("withoutHttpsCertificate", Description = "Removes HTTPS certificate configuration")] + [AspireExport(Description = "Removes HTTPS certificate configuration")] public static IResourceBuilder WithoutHttpsCertificate(this IResourceBuilder builder) where TResource : IResourceWithEnvironment, IResourceWithArgs { @@ -3429,7 +3429,7 @@ public static IResourceBuilder WithChildRelationship( /// /// /// - [AspireExport("withIconName", Description = "Sets the icon for the resource")] + [AspireExport(Description = "Sets the icon for the resource")] public static IResourceBuilder WithIconName(this IResourceBuilder builder, string iconName, IconVariant iconVariant = IconVariant.Filled) where T : IResource { ArgumentNullException.ThrowIfNull(builder); @@ -3635,7 +3635,7 @@ private static IResourceBuilder WithProbe(this IResourceBuilder builder /// The resource type. /// The resource builder. /// The . - [AspireExport("excludeFromMcp", Description = "Excludes the resource from MCP server exposure")] + [AspireExport(Description = "Excludes the resource from MCP server exposure")] public static IResourceBuilder ExcludeFromMcp(this IResourceBuilder builder) where T : IResource { ArgumentNullException.ThrowIfNull(builder); @@ -3744,7 +3744,7 @@ public static IResourceBuilder WithImagePushOptions( /// /// [Experimental("ASPIREPIPELINES003", UrlFormat = "https://aka.ms/aspire/diagnostics#{0}")] - [AspireExport("withRemoteImageName", Description = "Sets the remote image name for publishing")] + [AspireExport(Description = "Sets the remote image name for publishing")] public static IResourceBuilder WithRemoteImageName( this IResourceBuilder builder, string remoteImageName) @@ -3780,7 +3780,7 @@ public static IResourceBuilder WithRemoteImageName( /// /// [Experimental("ASPIREPIPELINES003", UrlFormat = "https://aka.ms/aspire/diagnostics#{0}")] - [AspireExport("withRemoteImageTag", Description = "Sets the remote image tag for publishing")] + [AspireExport(Description = "Sets the remote image tag for publishing")] public static IResourceBuilder WithRemoteImageTag( this IResourceBuilder builder, string remoteImageTag) diff --git a/tests/Aspire.Cli.EndToEnd.Tests/ProjectReferenceTests.cs b/tests/Aspire.Cli.EndToEnd.Tests/ProjectReferenceTests.cs index 0f1438b6146..7b91a02795e 100644 --- a/tests/Aspire.Cli.EndToEnd.Tests/ProjectReferenceTests.cs +++ b/tests/Aspire.Cli.EndToEnd.Tests/ProjectReferenceTests.cs @@ -108,7 +108,7 @@ namespace Aspire.Hosting; public static class MyIntegrationExtensions { - [AspireExport("addMyService")] + [AspireExport] public static IResourceBuilder AddMyService( this IDistributedApplicationBuilder builder, string name) => builder.AddContainer(name, "redis", "latest"); diff --git a/tests/Aspire.Hosting.Analyzers.Tests/AspireExportAnalyzerTests.cs b/tests/Aspire.Hosting.Analyzers.Tests/AspireExportAnalyzerTests.cs index b46904fcd02..ac88f65c00a 100644 --- a/tests/Aspire.Hosting.Analyzers.Tests/AspireExportAnalyzerTests.cs +++ b/tests/Aspire.Hosting.Analyzers.Tests/AspireExportAnalyzerTests.cs @@ -19,7 +19,7 @@ public async Task ValidExport_NoDiagnostics() public static class TestExports { - [AspireExport("testMethod", Description = "Test method")] + [AspireExport(Description = "Test method")] public static string TestMethod() => "test"; } """, []); @@ -37,7 +37,7 @@ public async Task ValidExportWithCamelCase_NoDiagnostics() public static class TestExports { - [AspireExport("addRedis", Description = "Add Redis")] + [AspireExport(Description = "Add Redis")] public static string AddRedis() => "test"; } """, []); @@ -75,7 +75,7 @@ public async Task InstanceMethod_ReportsASPIREEXPORT001() public class TestExports { - [AspireExport("instanceMethod")] + [AspireExport] public string InstanceMethod() => "test"; } """, @@ -95,7 +95,7 @@ public async Task InstanceMethodOnExportedType_NoDiagnostics() [AspireExport] public class TestExports { - [AspireExport("instanceMethod")] + [AspireExport] public string InstanceMethod() => "test"; } """, []); @@ -158,7 +158,7 @@ public async Task InvalidReturnType_ReportsASPIREEXPORT003() public static class TestExports { - [AspireExport("invalidReturn")] + [AspireExport] public static Stream InvalidReturn() => Stream.Null; } """, @@ -180,7 +180,7 @@ public async Task InvalidParameterType_ReportsASPIREEXPORT004() public static class TestExports { - [AspireExport("invalidParam")] + [AspireExport] public static void InvalidParam(Stream stream) { } } """, @@ -199,7 +199,7 @@ public async Task ValidPrimitiveTypes_NoDiagnostics() public static class TestExports { - [AspireExport("primitives")] + [AspireExport] public static int Primitives(string s, int i, bool b, double d, long l) => i; } """, []); @@ -217,7 +217,7 @@ public async Task ValidNullableTypes_NoDiagnostics() public static class TestExports { - [AspireExport("nullables")] + [AspireExport] public static int? Nullables(int? i, bool? b) => i; } """, []); @@ -236,10 +236,10 @@ public async Task ValidTaskReturn_NoDiagnostics() public static class TestExports { - [AspireExport("asyncMethod")] + [AspireExport] public static Task AsyncMethod() => Task.CompletedTask; - [AspireExport("asyncMethodWithResult")] + [AspireExport] public static Task AsyncMethodWithResult() => Task.FromResult("test"); } """, []); @@ -258,10 +258,10 @@ public async Task ValidValueTaskReturn_NoDiagnostics() public static class TestExports { - [AspireExport("asyncMethod")] + [AspireExport] public static ValueTask AsyncMethod() => ValueTask.CompletedTask; - [AspireExport("asyncMethodWithResult")] + [AspireExport] public static ValueTask AsyncMethodWithResult() => ValueTask.FromResult("test"); } """, []); @@ -281,7 +281,7 @@ public enum MyEnum { A, B, C } public static class TestExports { - [AspireExport("enumMethod")] + [AspireExport] public static MyEnum EnumMethod(MyEnum value) => value; } """, []); @@ -300,7 +300,7 @@ public async Task ValidDelegateParameter_NoDiagnostics() public static class TestExports { - [AspireExport("withCallback")] + [AspireExport] public static void WithCallback(Func callback) { } } """, []); @@ -325,7 +325,7 @@ public sealed class TestContext; public static class TestExports { - [AspireExport("withInlineCallback")] + [AspireExport] public static IResourceBuilder WithInlineCallback(this IResourceBuilder builder, Action callback) { callback(new TestContext()); @@ -355,7 +355,7 @@ public sealed class TestContext; public static class TestExports { - [AspireExport("withInlineOptionalCallback")] + [AspireExport] public static IResourceBuilder WithInlineOptionalCallback(this IResourceBuilder builder, Action? callback) { callback?.Invoke(new TestContext()); @@ -385,7 +385,7 @@ public sealed class TestContext; public static class TestExports { - [AspireExport("withInlineFunc")] + [AspireExport] public static IResourceBuilder WithInlineFunc(this IResourceBuilder builder, Func callback) { _ = callback(new TestContext()); @@ -418,7 +418,7 @@ public TestAnnotation(Action callback) { } public static class TestExports { - [AspireExport("withDeferredCallback")] + [AspireExport] public static IResourceBuilder WithDeferredCallback(this IResourceBuilder builder, Action callback) { return builder.WithAnnotation(new TestAnnotation(ctx => callback(ctx))); @@ -446,7 +446,7 @@ public sealed class TestContext; public static class TestExports { - [AspireExport("withInlineLambdaCallback")] + [AspireExport] public static IResourceBuilder WithInlineLambdaCallback(this IResourceBuilder builder, Action callback) { ((Action)(() => callback(new TestContext())))(); @@ -479,7 +479,7 @@ public TestAnnotation(Action callback) { } public static class TestExports { - [AspireExport("withDeferredLocalFunction")] + [AspireExport] public static IResourceBuilder WithDeferredLocalFunction(this IResourceBuilder builder, Action callback) { void InvokeCallback(TestContext context) => callback(context); @@ -508,7 +508,7 @@ public sealed class TestContext; public static class TestExports { - [AspireExport("withInlineLocalFunction")] + [AspireExport] public static IResourceBuilder WithInlineLocalFunction(this IResourceBuilder builder, Action callback) { void InvokeCallback() @@ -541,7 +541,7 @@ public sealed class TestContext; public static class TestExports { - [AspireExport("withInlineCallback", RunSyncOnBackgroundThread = true)] + [AspireExport(RunSyncOnBackgroundThread = true)] public static IResourceBuilder WithInlineCallback(this IResourceBuilder builder, Action callback) { callback(new TestContext()); @@ -569,7 +569,7 @@ public sealed class TestContext; [AspireExport(RunSyncOnBackgroundThread = true)] public static class TestExports { - [AspireExport("withInlineCallback")] + [AspireExport] public static IResourceBuilder WithInlineCallback(this IResourceBuilder builder, Action callback) { callback(new TestContext()); @@ -597,7 +597,7 @@ public sealed class TestContext; public static class TestExports { - [AspireExport("withAsyncCallback")] + [AspireExport] public static async Task> WithAsyncCallback(this IResourceBuilder builder, Func callback) { await callback(new TestContext()); @@ -619,7 +619,7 @@ public async Task ValidBuilderParameter_NoDiagnostics() public static class TestExports { - [AspireExport("builderMethod")] + [AspireExport] public static void BuilderMethod(IDistributedApplicationBuilder builder) { } } """, []); @@ -637,7 +637,7 @@ public async Task ValidParamsArray_NoDiagnostics() public static class TestExports { - [AspireExport("paramsMethod")] + [AspireExport] public static void ParamsMethod(params string[] args) { } } """, []); @@ -656,7 +656,7 @@ public async Task ValidCollectionTypes_NoDiagnostics() public static class TestExports { - [AspireExport("listMethod")] + [AspireExport] public static List ListMethod(Dictionary dict) => new(); [AspireExport("readonlyCollections")] @@ -729,7 +729,7 @@ public async Task AssemblyExportedExternalType_NoDiagnostics() public static class TestExports { - [AspireExport("getProvider")] + [AspireExport] public static IServiceProvider GetProvider(this IServiceProvider provider) => provider; } """, []); @@ -750,7 +750,7 @@ public async Task ArrayOfAssemblyExportedExternalType_NoDiagnostics() public static class TestExports { - [AspireExport("getChildren")] + [AspireExport] public static IServiceProvider[] GetChildren(IServiceProvider[] providers) => providers; } """, []); @@ -768,7 +768,7 @@ public async Task ValidObjectType_NoDiagnostics() public static class TestExports { - [AspireExport("objectMethod")] + [AspireExport] public static object ObjectMethod(object value) => value; } """, []); @@ -786,7 +786,7 @@ public async Task ValidArrayTypes_NoDiagnostics() public static class TestExports { - [AspireExport("arrayMethod")] + [AspireExport] public static string[] ArrayMethod(int[] numbers) => []; } """, []); @@ -808,7 +808,7 @@ public async Task InvalidCollectionElementType_ReportsASPIREEXPORT004() public static class TestExports { - [AspireExport("invalidList")] + [AspireExport] public static void InvalidList(List streams) { } } """, @@ -831,7 +831,7 @@ public async Task UnionWithSingleType_ReportsASPIREEXPORT005() public static class TestExports { - [AspireExport("singleUnion")] + [AspireExport] public static void SingleUnion([AspireUnion(typeof(string))] object value) { } } """, @@ -852,7 +852,7 @@ public async Task UnionWithEmptyTypes_ReportsASPIREEXPORT005() public static class TestExports { - [AspireExport("emptyUnion")] + [AspireExport] public static void EmptyUnion([AspireUnion()] object value) { } } """, @@ -871,7 +871,7 @@ public async Task ValidUnionWithTwoTypes_NoDiagnostics() public static class TestExports { - [AspireExport("validUnion")] + [AspireExport] public static void ValidUnion([AspireUnion(typeof(string), typeof(int))] object value) { } } """, []); @@ -889,7 +889,7 @@ public async Task ValidUnionWithMultipleTypes_NoDiagnostics() public static class TestExports { - [AspireExport("multiUnion")] + [AspireExport] public static void MultiUnion([AspireUnion(typeof(string), typeof(int), typeof(bool))] object value) { } } """, []); @@ -912,7 +912,7 @@ public async Task UnionWithIncompatibleType_ReportsASPIREEXPORT006() public static class TestExports { - [AspireExport("invalidUnion")] + [AspireExport] public static void InvalidUnion([AspireUnion(typeof(string), typeof(Stream))] object value) { } } """, @@ -935,7 +935,7 @@ public class MyPlainClass { } public static class TestExports { - [AspireExport("plainClassUnion")] + [AspireExport] public static void PlainClassUnion([AspireUnion(typeof(string), typeof(MyPlainClass))] object value) { } } """, @@ -957,7 +957,7 @@ public class MyDtoType { public string Name { get; set; } = ""; } public static class TestExports { - [AspireExport("dtoUnion")] + [AspireExport] public static void DtoUnion([AspireUnion(typeof(string), typeof(MyDtoType))] object value) { } } """, []); @@ -975,7 +975,7 @@ public async Task UnionWithPrimitives_NoDiagnostics() public static class TestExports { - [AspireExport("primitiveUnion")] + [AspireExport] public static void PrimitiveUnion([AspireUnion(typeof(string), typeof(int), typeof(bool))] object value) { } } """, []); @@ -997,7 +997,7 @@ public async Task DuplicateExportIdSameTargetType_ReportsASPIREEXPORT007() public static class TestExports { - [AspireExport("addThing")] + [AspireExport] public static void AddThing(this IDistributedApplicationBuilder builder, string name) { } [AspireExport("addThing")] @@ -1022,10 +1022,10 @@ public async Task DifferentExportIdsSameTargetType_NoDiagnostics() public static class TestExports { - [AspireExport("addThing")] + [AspireExport] public static void AddThing(this IDistributedApplicationBuilder builder, string name) { } - [AspireExport("addThingWithPort")] + [AspireExport] public static void AddThingWithPort(this IDistributedApplicationBuilder builder, string name, int port) { } } """, []); @@ -1075,7 +1075,7 @@ public async Task NonExtensionMethod_NoDuplicateCheck() public static class TestExports { - [AspireExport("getValue")] + [AspireExport] public static string GetValue() => "test"; [AspireExport("getValue")] @@ -1099,7 +1099,7 @@ public async Task UnionWithIResource_NoDiagnostics() public static class TestExports { - [AspireExport("resourceUnion")] + [AspireExport] public static void ResourceUnion([AspireUnion(typeof(string), typeof(IResource))] object value) { } } """, []); @@ -1119,7 +1119,7 @@ public enum MyEnum { A, B, C } public static class TestExports { - [AspireExport("enumUnion")] + [AspireExport] public static void EnumUnion([AspireUnion(typeof(string), typeof(MyEnum))] object value) { } } """, []); @@ -1140,7 +1140,7 @@ public class MyExportType { public string Name { get; set; } = ""; } public static class TestExports { - [AspireExport("exportTypeUnion")] + [AspireExport] public static void ExportTypeUnion([AspireUnion(typeof(string), typeof(MyExportType))] object value) { } } """, []); @@ -1163,7 +1163,7 @@ public class MyPlainClass { } public static class TestExports { - [AspireExport("multiInvalid")] + [AspireExport] public static void MultiInvalid([AspireUnion(typeof(Stream), typeof(MyPlainClass))] object value) { } } """, @@ -1189,7 +1189,7 @@ public async Task DuplicateExportIdAcrossClasses_ReportsASPIREEXPORT007() public static class ClassA { - [AspireExport("addThing")] + [AspireExport] public static void AddThing(this IDistributedApplicationBuilder builder, string name) { } } @@ -1254,7 +1254,7 @@ public async Task SingleInvalidType_ReportsBothASPIREEXPORT005AndASPIREEXPORT006 public static class TestExports { - [AspireExport("singleInvalid")] + [AspireExport] public static void SingleInvalid([AspireUnion(typeof(Stream))] object value) { } } """, @@ -1339,7 +1339,7 @@ public async Task MissingExportAttribute_WithAspireExport_NoDiagnostics() public static class TestExports { - [AspireExport("addThing")] + [AspireExport] public static void AddThing(this IDistributedApplicationBuilder builder, string name) { } } """, []); @@ -1529,7 +1529,7 @@ public class MyResource : IResource public static class ExportedMethods { - [AspireExport("addThing")] + [AspireExport] public static IResourceBuilder AddThing(this IDistributedApplicationBuilder builder, string name) => throw null!; } @@ -1601,6 +1601,40 @@ internal static IResourceBuilder WithRoleAssignments( await test.RunAsync(); } + [Fact] + public async Task ExportNameMatchesMethodName_WithConcreteTarget_ParameterlessAspireExport_ReportsASPIREEXPORT009() + { + var diagnostic = AspireExportAnalyzer.Diagnostics.s_exportNameShouldBeUnique; + + var test = AnalyzerTest.Create(""" + using Aspire.Hosting; + using Aspire.Hosting.ApplicationModel; + using System.Collections.Generic; + + var builder = DistributedApplication.CreateBuilder(args); + + public class MyResource : IResource + { + public string Name => "test"; + public ResourceAnnotationCollection Annotations { get; } = new(); + } + + public static class TestExports + { + [AspireExport] + internal static IResourceBuilder WithRoleAssignments( + this IResourceBuilder builder, + IResourceBuilder target, + params string[] roles) + where T : IResource + => builder; + } + """, + [new DiagnosticResult(diagnostic).WithLocation(15, 6).WithArguments("withRoleAssignments", "WithRoleAssignments", "MyResource", "withMyRoleAssignments")]); + + await test.RunAsync(); + } + [Fact] public async Task ExportNameIsUnique_WithConcreteTarget_NoDiagnostics() { @@ -1645,7 +1679,7 @@ public async Task ExportNameMatchesMethodName_NoConcreteTarget_NoDiagnostics() public static class TestExports { - [AspireExport("withEnvironment")] + [AspireExport] internal static IResourceBuilder WithEnvironment( this IResourceBuilder builder, string name, @@ -1669,7 +1703,7 @@ public async Task ExportNameMatchesMethodName_WithInterfaceTarget_NoDiagnostics( public static class TestExports { - [AspireExport("withReference")] + [AspireExport] internal static IResourceBuilder WithReference( this IResourceBuilder builder, IResourceBuilder target) @@ -1700,7 +1734,7 @@ public class MyResource : IResource public static class TestExports { - [AspireExport("addDatabase")] + [AspireExport] internal static IResourceBuilder AddDatabase( this IResourceBuilder builder, string name) @@ -1744,4 +1778,112 @@ internal static IResourceBuilder WithRoleAssignments( await test.RunAsync(); } + + // ASPIREEXPORT011 Tests - Redundant explicit export ID that matches convention + + [Fact] + public async Task RedundantExportId_MatchesConvention_ReportsASPIREEXPORT011() + { + var diagnostic = AspireExportAnalyzer.Diagnostics.s_redundantExportId; + + var test = AnalyzerTest.Create(""" + using Aspire.Hosting; + + var builder = DistributedApplication.CreateBuilder(args); + + public static class TestExports + { + [AspireExport("addRedis")] + public static string AddRedis() => "test"; + } + """, + [new DiagnosticResult(diagnostic).WithLocation(7, 6).WithArguments("addRedis", "AddRedis")]); + + await test.RunAsync(); + } + + [Fact] + public async Task NonRedundantExportId_DoesNotMatchConvention_NoDiagnostics() + { + var test = AnalyzerTest.Create(""" + using Aspire.Hosting; + + var builder = DistributedApplication.CreateBuilder(args); + + public static class TestExports + { + [AspireExport("addRedisWithPort")] + public static string AddRedis(int port) => "test"; + } + """, []); + + await test.RunAsync(); + } + + [Fact] + public async Task RedundantExportId_InstanceMethod_CamelCaseOnlyNotMatchingConvention_NoDiagnostics() + { + // For instance methods in a type with ExposeMethods=true, the convention is + // "TypeName.camelCaseMethod" (e.g. "MyClass.getValue"), not just "getValue". + // So [AspireExport("getValue")] on GetValue does NOT trigger ASPIREEXPORT011. + var test = AnalyzerTest.Create(""" + using Aspire.Hosting; + + var builder = DistributedApplication.CreateBuilder(args); + + [AspireExport(ExposeMethods = true)] + public class MyClass + { + [AspireExport("getValue")] + public string GetValue() => "test"; + } + """, []); + + await test.RunAsync(); + } + + [Fact] + public async Task RedundantExportId_InstanceMethod_TypePrefixMatchesConvention_ReportsASPIREEXPORT011() + { + // [AspireExport("MyClass.getValue")] on GetValue matches the convention-derived id + // "MyClass.getValue", so ASPIREEXPORT011 fires. + var diagnostic = AspireExportAnalyzer.Diagnostics.s_redundantExportId; + + var test = AnalyzerTest.Create(""" + using Aspire.Hosting; + + var builder = DistributedApplication.CreateBuilder(args); + + [AspireExport(ExposeMethods = true)] + public class MyClass + { + [AspireExport("MyClass.getValue")] + public string GetValue() => "test"; + } + """, + [new DiagnosticResult(diagnostic).WithLocation(8, 6).WithArguments("MyClass.getValue", "GetValue")]); + + await test.RunAsync(); + } + + [Fact] + public async Task RedundantExportId_InstanceMethod_NoExplicitId_NoDiagnostics() + { + // Parameterless [AspireExport] on an instance method derives the id automatically. + // No ASPIREEXPORT011 is expected. + var test = AnalyzerTest.Create(""" + using Aspire.Hosting; + + var builder = DistributedApplication.CreateBuilder(args); + + [AspireExport(ExposeMethods = true)] + public class MyClass + { + [AspireExport] + public string GetValue() => "test"; + } + """, []); + + await test.RunAsync(); + } } diff --git a/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/TestTypes/TestExtensions.cs b/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/TestTypes/TestExtensions.cs index 426325a9683..37b4c4a089c 100644 --- a/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/TestTypes/TestExtensions.cs +++ b/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/TestTypes/TestExtensions.cs @@ -13,7 +13,7 @@ public static class TestExtensions /// /// Adds a test Redis resource. /// - [AspireExport("addTestRedis", Description = "Adds a test Redis resource")] + [AspireExport(Description = "Adds a test Redis resource")] public static IResourceBuilder AddTestRedis( this IDistributedApplicationBuilder builder, string name, @@ -46,7 +46,7 @@ public static IResourceBuilder AddTestDatabase( /// This method tests the factory method codegen pattern where a method on builder type A /// returns builder type B (e.g., SqlServerServerResource.AddDatabase returning SqlServerDatabaseResource). /// - [AspireExport("addTestChildDatabase", Description = "Adds a child database to a test Redis resource")] + [AspireExport(Description = "Adds a child database to a test Redis resource")] public static IResourceBuilder AddTestChildDatabase( this IResourceBuilder builder, string name, @@ -62,7 +62,7 @@ public static IResourceBuilder AddTestChildDatabase( /// /// Configures the Redis resource with persistence. /// - [AspireExport("withPersistence", Description = "Configures the Redis resource with persistence")] + [AspireExport(Description = "Configures the Redis resource with persistence")] public static IResourceBuilder WithPersistence( this IResourceBuilder builder, TestPersistenceMode mode = TestPersistenceMode.Volume) @@ -84,7 +84,7 @@ public static IResourceBuilder WithCustomCallback( /// /// Adds an optional string parameter. /// - [AspireExport("withOptionalString", Description = "Adds an optional string parameter")] + [AspireExport(Description = "Adds an optional string parameter")] public static IResourceBuilder WithOptionalString( this IResourceBuilder builder, string? value = null, @@ -389,7 +389,7 @@ public static IResourceBuilder WithQuadTransform( /// /// Tests DTO parameter - verifies [AspireDto] generates TypeScript interface. /// - [AspireExport("withConfig", Description = "Configures the resource with a DTO")] + [AspireExport(Description = "Configures the resource with a DTO")] public static IResourceBuilder WithConfig( this IResourceBuilder builder, TestConfigDto config) where T : IResource @@ -400,7 +400,7 @@ public static IResourceBuilder WithConfig( /// /// Tests mutable List return type - verifies AspireList wrapper generation. /// - [AspireExport("getTags", Description = "Gets the tags for the resource")] + [AspireExport(Description = "Gets the tags for the resource")] public static List GetTags(this IResourceBuilder builder) { return []; @@ -409,7 +409,7 @@ public static List GetTags(this IResourceBuilder buil /// /// Tests mutable Dictionary return type - verifies AspireDict wrapper generation. /// - [AspireExport("getMetadata", Description = "Gets the metadata for the resource")] + [AspireExport(Description = "Gets the metadata for the resource")] public static Dictionary GetMetadata(this IResourceBuilder builder) { return []; @@ -418,7 +418,7 @@ public static Dictionary GetMetadata(this IResourceBuilder /// Tests ReferenceExpression parameter - verifies special handling (pass directly via toJSON). /// - [AspireExport("withConnectionString", Description = "Sets the connection string using a reference expression")] + [AspireExport(Description = "Sets the connection string using a reference expression")] public static IResourceBuilder WithConnectionString( this IResourceBuilder builder, ReferenceExpression connectionString) where T : IResourceWithConnectionString @@ -430,7 +430,7 @@ public static IResourceBuilder WithConnectionString( /// Tests callback receiving context wrapper. /// Verifies callback auto-wraps handle into context class with property-like objects. /// - [AspireExport("testWithEnvironmentCallback", Description = "Configures environment with callback (test version)")] + [AspireExport(Description = "Configures environment with callback (test version)")] public static IResourceBuilder TestWithEnvironmentCallback( this IResourceBuilder builder, Func callback) where T : IResourceWithEnvironment @@ -441,7 +441,7 @@ public static IResourceBuilder TestWithEnvironmentCallback( /// /// Tests DateTime parameter - verifies mapping to ISO 8601 string. /// - [AspireExport("withCreatedAt", Description = "Sets the created timestamp")] + [AspireExport(Description = "Sets the created timestamp")] public static IResourceBuilder WithCreatedAt( this IResourceBuilder builder, DateTime createdAt) where T : IResource @@ -452,7 +452,7 @@ public static IResourceBuilder WithCreatedAt( /// /// Tests DateTimeOffset parameter - verifies mapping to ISO 8601 string. /// - [AspireExport("withModifiedAt", Description = "Sets the modified timestamp")] + [AspireExport(Description = "Sets the modified timestamp")] public static IResourceBuilder WithModifiedAt( this IResourceBuilder builder, DateTimeOffset modifiedAt) where T : IResource @@ -463,7 +463,7 @@ public static IResourceBuilder WithModifiedAt( /// /// Tests Guid parameter - verifies mapping to string. /// - [AspireExport("withCorrelationId", Description = "Sets the correlation ID")] + [AspireExport(Description = "Sets the correlation ID")] public static IResourceBuilder WithCorrelationId( this IResourceBuilder builder, Guid correlationId) where T : IResource @@ -474,7 +474,7 @@ public static IResourceBuilder WithCorrelationId( /// /// Tests optional callback parameter - verifies conditional callback registration. /// - [AspireExport("withOptionalCallback", Description = "Configures with optional callback")] + [AspireExport(Description = "Configures with optional callback")] public static IResourceBuilder WithOptionalCallback( this IResourceBuilder builder, Func? callback = null) where T : IResource @@ -486,7 +486,7 @@ public static IResourceBuilder WithOptionalCallback( /// /// Tests enum parameter - verifies string literal union generation. /// - [AspireExport("withStatus", Description = "Sets the resource status")] + [AspireExport(Description = "Sets the resource status")] public static IResourceBuilder WithStatus( this IResourceBuilder builder, TestResourceStatus status) where T : IResource @@ -497,7 +497,7 @@ public static IResourceBuilder WithStatus( /// /// Tests nested DTO parameter. /// - [AspireExport("withNestedConfig", Description = "Configures with nested DTO")] + [AspireExport(Description = "Configures with nested DTO")] public static IResourceBuilder WithNestedConfig( this IResourceBuilder builder, TestNestedDto config) where T : IResource @@ -508,7 +508,7 @@ public static IResourceBuilder WithNestedConfig( /// /// Tests async callback with context that returns a value. /// - [AspireExport("withValidator", Description = "Adds validation callback")] + [AspireExport(Description = "Adds validation callback")] public static IResourceBuilder WithValidator( this IResourceBuilder builder, Func> validator) where T : IResource @@ -520,7 +520,7 @@ public static IResourceBuilder WithValidator( /// Tests builder passed as parameter to another capability. /// Verifies wrapper class acceptance with internal handle extraction. /// - [AspireExport("testWaitFor", Description = "Waits for another resource (test version)")] + [AspireExport(Description = "Waits for another resource (test version)")] public static IResourceBuilder TestWaitFor( this IResourceBuilder builder, IResourceBuilder dependency) where T : IResource @@ -531,7 +531,7 @@ public static IResourceBuilder TestWaitFor( /// /// Tests readonly array return type - verifies copy/pass directly. /// - [AspireExport("getEndpoints", Description = "Gets the endpoints")] + [AspireExport(Description = "Gets the endpoints")] public static string[] GetEndpoints(this IResourceBuilder builder) { return []; @@ -544,7 +544,7 @@ public static string[] GetEndpoints(this IResourceBuilder bui /// This targets IResourceWithConnectionString directly, not via generic parameter. /// Should expand to all types implementing IResourceWithConnectionString. /// - [AspireExport("withConnectionStringDirect", Description = "Sets connection string using direct interface target")] + [AspireExport(Description = "Sets connection string using direct interface target")] public static IResourceBuilder WithConnectionStringDirect( IResourceBuilder builder, string connectionString) @@ -557,7 +557,7 @@ public static IResourceBuilder WithConnectionStri /// This targets TestRedisResource directly (extends ContainerResource). /// Should expand to TestRedisResource AND any types that inherit from it. /// - [AspireExport("withRedisSpecific", Description = "Redis-specific configuration")] + [AspireExport(Description = "Redis-specific configuration")] public static IResourceBuilder WithRedisSpecific( IResourceBuilder builder, string option) @@ -569,7 +569,7 @@ public static IResourceBuilder WithRedisSpecific( /// Pattern 4/5: Tests interface/concrete type as parameter (not target). /// The dependency parameter should generate a union type: Handle | ResourceBuilderBase. /// - [AspireExport("withDependency", Description = "Adds a dependency on another resource")] + [AspireExport(Description = "Adds a dependency on another resource")] public static IResourceBuilder WithDependency( this IResourceBuilder builder, IResourceBuilder dependency) where T : IResource @@ -592,7 +592,7 @@ public static IResourceBuilder WithUnionDependency( /// /// Tests IReadOnlyList parameter - verifies readonly array handling. /// - [AspireExport("withEndpoints", Description = "Sets the endpoints")] + [AspireExport(Description = "Sets the endpoints")] public static IResourceBuilder WithEndpoints( this IResourceBuilder builder, IReadOnlyList endpoints) where T : IResource @@ -603,7 +603,7 @@ public static IResourceBuilder WithEndpoints( /// /// Tests IReadOnlyDictionary parameter - verifies readonly dict handling. /// - [AspireExport("withEnvironmentVariables", Description = "Sets environment variables")] + [AspireExport(Description = "Sets environment variables")] public static IResourceBuilder WithEnvironmentVariables( this IResourceBuilder builder, IReadOnlyDictionary variables) where T : IResourceWithEnvironment @@ -616,7 +616,7 @@ public static IResourceBuilder WithEnvironmentVariables( /// /// Tests CancellationToken parameter - generated TypeScript should accept AbortSignal or CancellationToken for inputs. /// - [AspireExport("getStatusAsync", Description = "Gets the status of the resource asynchronously")] + [AspireExport(Description = "Gets the status of the resource asynchronously")] public static Task GetStatusAsync( this IResourceBuilder builder, CancellationToken cancellationToken = default) @@ -627,7 +627,7 @@ public static Task GetStatusAsync( /// /// Tests CancellationToken in callback parameter - generated TypeScript should materialize host values as CancellationToken. /// - [AspireExport("withCancellableOperation", Description = "Performs a cancellable operation")] + [AspireExport(Description = "Performs a cancellable operation")] public static IResourceBuilder WithCancellableOperation( this IResourceBuilder builder, Func operation) where T : IResource @@ -638,7 +638,7 @@ public static IResourceBuilder WithCancellableOperation( /// /// Tests CancellationToken mixed with other parameters. /// - [AspireExport("waitForReadyAsync", Description = "Waits for the resource to be ready")] + [AspireExport(Description = "Waits for the resource to be ready")] public static Task WaitForReadyAsync( this IResourceBuilder builder, TimeSpan timeout, @@ -652,7 +652,7 @@ public static Task WaitForReadyAsync( /// /// Tests multi-parameter callback with handle types for destructuring codegen. /// - [AspireExport("withMultiParamHandleCallback", Description = "Tests multi-param callback destructuring")] + [AspireExport(Description = "Tests multi-param callback destructuring")] public static IResourceBuilder WithMultiParamHandleCallback( this IResourceBuilder builder, Func callback) @@ -666,7 +666,7 @@ public static IResourceBuilder WithMultiParamHandleCallback( /// WithDataVolume on TestRedisResource — has both name and isReadOnly parameters. /// Tests that options interfaces merge parameters across overloads targeting different types. /// - [AspireExport("withDataVolume", Description = "Adds a data volume with persistence")] + [AspireExport(Description = "Adds a data volume with persistence")] public static IResourceBuilder WithDataVolume( this IResourceBuilder builder, string? name = null, @@ -680,7 +680,7 @@ public static IResourceBuilder WithDataVolume( /// When combined with the TestRedisResource overload, the generated WithDataVolumeOptions /// interface must include both name and isReadOnly (the union of all parameters). /// - [AspireExport("withDataVolume", Description = "Adds a data volume")] + [AspireExport(Description = "Adds a data volume")] public static IResourceBuilder WithDataVolume( this IResourceBuilder builder, string? name = null) @@ -693,7 +693,7 @@ public static IResourceBuilder WithDataVolume( /// /// Targets the concrete TestVaultResource so it gets a builder class named "TestVaultResource". /// - [AspireExport("addTestVault", Description = "Adds a test vault resource")] + [AspireExport(Description = "Adds a test vault resource")] public static IResourceBuilder AddTestVault( this IDistributedApplicationBuilder builder, string name) @@ -706,7 +706,7 @@ public static IResourceBuilder AddTestVault( /// DeriveClassName strips the 'I' prefix producing "TestVaultResource" — the same name /// as the concrete builder. The codegen must deduplicate to avoid emitting two classes. /// - [AspireExport("withVaultDirect", Description = "Configures vault using direct interface target")] + [AspireExport(Description = "Configures vault using direct interface target")] public static IResourceBuilder WithVaultDirect( IResourceBuilder builder, string option) @@ -723,7 +723,7 @@ public static IResourceBuilder WithVaultDirect( /// Scenario 1: Single-param merge — one overload has name only, the other adds tag. /// Tests merge where the option variation is: single type vs tuple(type, type). /// - [AspireExport("withMergeLabel", Description = "Adds a label to the resource")] + [AspireExport(Description = "Adds a label to the resource")] public static IResourceBuilder WithMergeLabel( this IResourceBuilder builder, string label) where T : IResource @@ -747,7 +747,7 @@ public static IResourceBuilder WithMergeLabel( /// Scenario 2: Tuple-param merge — both have multiple required params, differ by one. /// Tests merge where the option variation is: tuple(type, type) vs tuple(type, type, type). /// - [AspireExport("withMergeEndpoint", Description = "Configures a named endpoint")] + [AspireExport(Description = "Configures a named endpoint")] public static IResourceBuilder WithMergeEndpoint( this IResourceBuilder builder, string endpointName, @@ -773,7 +773,7 @@ public static IResourceBuilder WithMergeEndpoint( /// Scenario 3: Dict/Parameters merge — both have required + optional params, differ by one. /// Tests merge where the option variation involves Parameters dict. /// - [AspireExport("withMergeLogging", Description = "Configures resource logging")] + [AspireExport(Description = "Configures resource logging")] public static IResourceBuilder WithMergeLogging( this IResourceBuilder builder, string logLevel, @@ -801,7 +801,7 @@ public static IResourceBuilder WithMergeLogging( /// Scenario 4: Both-dict merge — both overloads have 4+ required params so both use Parameters dicts. /// The shorter overload has 4 required params, the longer has 5. /// - [AspireExport("withMergeRoute", Description = "Configures a route")] + [AspireExport(Description = "Configures a route")] public static IResourceBuilder WithMergeRoute( this IResourceBuilder builder, string path, diff --git a/tests/Aspire.Hosting.RemoteHost.Tests/AtsCapabilityScannerTests.cs b/tests/Aspire.Hosting.RemoteHost.Tests/AtsCapabilityScannerTests.cs index b0491320bbb..3dba6711d0c 100644 --- a/tests/Aspire.Hosting.RemoteHost.Tests/AtsCapabilityScannerTests.cs +++ b/tests/Aspire.Hosting.RemoteHost.Tests/AtsCapabilityScannerTests.cs @@ -400,21 +400,21 @@ public sealed class AssemblyLevelExportedTestType private static class TestExports { - [AspireExport("testEnumerableParameter")] + [AspireExport] public static void TestEnumerableParameter(IDistributedApplicationBuilder builder, IEnumerable items) { _ = builder; _ = items; } - [AspireExport("testEnumerableReturn")] + [AspireExport] public static IEnumerable TestEnumerableReturn(IDistributedApplicationBuilder builder) { _ = builder; return []; } - [AspireExport("testMultiParamHandleCallback")] + [AspireExport] public static IResourceBuilder TestMultiParamHandleCallback( IResourceBuilder builder, Func callback) diff --git a/tests/Aspire.Hosting.RemoteHost.Tests/AttributeDataReaderTests.cs b/tests/Aspire.Hosting.RemoteHost.Tests/AttributeDataReaderTests.cs index 0f244262977..34b1f53151c 100644 --- a/tests/Aspire.Hosting.RemoteHost.Tests/AttributeDataReaderTests.cs +++ b/tests/Aspire.Hosting.RemoteHost.Tests/AttributeDataReaderTests.cs @@ -209,7 +209,7 @@ public static void OverriddenNameMethod(IResource resource) _ = resource; } - [AspireExport("officialUnionMethod")] + [AspireExport] public static void OfficialUnionMethod([AspireUnion(typeof(string), typeof(int))] object value) { _ = value; diff --git a/tests/Aspire.Hosting.RemoteHost.Tests/CapabilityDispatcherTests.cs b/tests/Aspire.Hosting.RemoteHost.Tests/CapabilityDispatcherTests.cs index 2c8ae3c5af7..f58102769c4 100644 --- a/tests/Aspire.Hosting.RemoteHost.Tests/CapabilityDispatcherTests.cs +++ b/tests/Aspire.Hosting.RemoteHost.Tests/CapabilityDispatcherTests.cs @@ -1452,13 +1452,13 @@ private static (AtsMarshaller Marshaller, AtsCallbackProxyFactory CallbackFactor /// internal static class TestCapabilities { - [AspireExport("testMethod", Description = "Test method")] + [AspireExport(Description = "Test method")] public static string TestMethod(string value) { return value.ToUpperInvariant(); } - [AspireExport("withOptional", Description = "Method with optional parameter")] + [AspireExport(Description = "Method with optional parameter")] public static string WithOptional(string required, string optional = "default") { return $"{required}:{optional}"; @@ -1471,28 +1471,28 @@ public static async Task AsyncVoidMethod(string value) _ = value; // Use the parameter to avoid warning } - [AspireExport("asyncWithResult", Description = "Async method returning Task")] + [AspireExport(Description = "Async method returning Task")] public static async Task AsyncWithResult(string value) { await Task.Delay(1); return value.ToUpperInvariant(); } - [AspireExport("asyncValueTaskWithResult", Description = "Async method returning ValueTask")] + [AspireExport(Description = "Async method returning ValueTask")] public static async ValueTask AsyncValueTaskWithResult(string value) { await Task.Delay(1); return value.ToUpperInvariant(); } - [AspireExport("asyncThrows", Description = "Async method that throws")] + [AspireExport(Description = "Async method that throws")] public static async Task AsyncThrows(string value) { await Task.Delay(1); throw new InvalidOperationException("Async error: " + value); } - [AspireExport("canObserveCancellation", Description = "Tests cancellation token round-tripping")] + [AspireExport(Description = "Tests cancellation token round-tripping")] public static bool CanObserveCancellation(CancellationToken cancellationToken) { return cancellationToken.IsCancellationRequested; @@ -1607,7 +1607,7 @@ internal static class TestCapabilitiesWithCallback /// /// A method that accepts a callback but doesn't invoke it. /// - [AspireExport("withCallback", Description = "Method with callback parameter")] + [AspireExport(Description = "Method with callback parameter")] public static string WithCallback(string value, Action callback) { // The callback is provided but we don't invoke it in this test @@ -1618,7 +1618,7 @@ public static string WithCallback(string value, Action callback) /// /// A method that invokes the callback. /// - [AspireExport("invokeCallback", Description = "Method that invokes callback")] + [AspireExport(Description = "Method that invokes callback")] public static void InvokeCallback(Func callback) { callback().GetAwaiter().GetResult(); @@ -1627,7 +1627,7 @@ public static void InvokeCallback(Func callback) /// /// A method that invokes a typed callback with arguments. /// - [AspireExport("invokeTypedCallback", Description = "Method that invokes typed callback")] + [AspireExport(Description = "Method that invokes typed callback")] public static void InvokeTypedCallback(Func callback) { callback("hello from C#").GetAwaiter().GetResult(); @@ -1636,7 +1636,7 @@ public static void InvokeTypedCallback(Func callback) /// /// A method with an async callback that returns a value. /// - [AspireExport("withAsyncCallback", Description = "Method with async callback returning value")] + [AspireExport(Description = "Method with async callback returning value")] public static int WithAsyncCallback(Func> callback) { return callback().GetAwaiter().GetResult(); @@ -1652,25 +1652,25 @@ public static void ResetLastObservedThreadId() LastObservedThreadId = 0; } - [AspireExport("syncInlineThreadProbe", Description = "Captures the current thread for inline sync invocation")] + [AspireExport(Description = "Captures the current thread for inline sync invocation")] public static int SyncInlineThreadProbe() { return Environment.CurrentManagedThreadId; } - [AspireExport("syncBackgroundThreadProbe", Description = "Captures the current thread for background-thread sync invocation", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Captures the current thread for background-thread sync invocation", RunSyncOnBackgroundThread = true)] public static int SyncBackgroundThreadProbe() { return Environment.CurrentManagedThreadId; } - [AspireExport("valueTaskBackgroundThreadProbe", Description = "Captures the current thread for ValueTask invocation", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Captures the current thread for ValueTask invocation", RunSyncOnBackgroundThread = true)] public static ValueTask ValueTaskBackgroundThreadProbe() { return ValueTask.FromResult(Environment.CurrentManagedThreadId); } - [AspireExport("nonGenericValueTaskBackgroundThreadProbe", Description = "Captures the current thread for ValueTask invocation", RunSyncOnBackgroundThread = true)] + [AspireExport(Description = "Captures the current thread for ValueTask invocation", RunSyncOnBackgroundThread = true)] public static ValueTask NonGenericValueTaskBackgroundThreadProbe() { LastObservedThreadId = Environment.CurrentManagedThreadId; @@ -1683,13 +1683,13 @@ public static ValueTask NonGenericValueTaskBackgroundThreadProbe() /// internal static class TestTypeCategoryCapabilities { - [AspireExport("sumArray", Description = "Sums an integer array")] + [AspireExport(Description = "Sums an integer array")] public static int SumArray(int[] values) { return values.Sum(); } - [AspireExport("returnArray", Description = "Returns a string array")] + [AspireExport(Description = "Returns a string array")] public static string[] ReturnArray(int count) { return Enumerable.Range(0, count).Select(i => $"item{i}").ToArray(); @@ -1701,19 +1701,19 @@ public static int SumReadOnlyList(IReadOnlyList values) return values.Sum(); } - [AspireExport("acceptUnion", Description = "Accepts a union of string or int")] + [AspireExport(Description = "Accepts a union of string or int")] public static string AcceptUnion([AspireUnion(typeof(string), typeof(int))] object value) { return value.ToString()!; } - [AspireExport("returnMutableList", Description = "Returns a mutable List")] + [AspireExport(Description = "Returns a mutable List")] public static List ReturnMutableList() { return ["first", "second", "third"]; } - [AspireExport("returnMutableDict", Description = "Returns a mutable Dictionary")] + [AspireExport(Description = "Returns a mutable Dictionary")] public static Dictionary ReturnMutableDict() { return new Dictionary @@ -1739,19 +1739,19 @@ internal enum TestDispatchEnum /// internal static class TestEnumCapabilities { - [AspireExport("acceptEnum", Description = "Accepts an enum parameter")] + [AspireExport(Description = "Accepts an enum parameter")] public static string AcceptEnum(TestDispatchEnum value) { return $"Received: {value}"; } - [AspireExport("returnEnum", Description = "Returns an enum value")] + [AspireExport(Description = "Returns an enum value")] public static TestDispatchEnum ReturnEnum(string name) { return Enum.Parse(name); } - [AspireExport("acceptOptionalEnum", Description = "Accepts an optional enum parameter")] + [AspireExport(Description = "Accepts an optional enum parameter")] public static string AcceptOptionalEnum(TestDispatchEnum? value = null) { return value.HasValue ? $"Received: {value.Value}" : "No value";