1 instantiation of ResourceAnnotationMutationBehavior
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
2285return builder.WithAnnotation<SuppressPublishValidationAnnotation>(new());
125 references to ResourceAnnotationMutationBehavior
Aspire.Hosting (53)
ApplicationModel\IResourceBuilder.cs (4)
29IResourceBuilder<T> WithAnnotation<TAnnotation>(ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation, new() => WithAnnotation(new TAnnotation(), behavior); 39IResourceBuilder<T> WithAnnotation<TAnnotation>(TAnnotation annotation, ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation;
ApplicationModel\ResourceAnnotationMutationBehavior.cs (1)
7/// Specifies behavior of the <see cref="IResourceBuilder{T}.WithAnnotation{TAnnotation}(Aspire.Hosting.ApplicationModel.ResourceAnnotationMutationBehavior)" />
ApplicationModel\ResourceExtensions.cs (2)
553return builder.WithAnnotation(new ContainerBuildOptionsCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Append); 573return builder.WithAnnotation(new ContainerBuildOptionsCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Append);
ContainerResourceBuilderExtensions.cs (17)
94}), ResourceAnnotationMutationBehavior.Replace); 103}), ResourceAnnotationMutationBehavior.Append); 623}, ResourceAnnotationMutationBehavior.Replace) 624.WithAnnotation(new ContainerLifetimeAnnotation { Lifetime = lifetime }, ResourceAnnotationMutationBehavior.Replace); 640return builder.WithAnnotation(new ContainerImagePullPolicyAnnotation { ImagePullPolicy = pullPolicy }, ResourceAnnotationMutationBehavior.Replace); 748return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 753return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 898return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 899.WithAnnotation(defaultContainerBuildOptions, ResourceAnnotationMutationBehavior.Append) 903return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 904.WithAnnotation(defaultContainerBuildOptions, ResourceAnnotationMutationBehavior.Append) 1140return builder.WithAnnotation(new ContainerNameAnnotation { Name = name }, ResourceAnnotationMutationBehavior.Replace); 1346}, ResourceAnnotationMutationBehavior.Replace); 1433return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Append); 1505return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Append); 1548return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Append); 1952}, ResourceAnnotationMutationBehavior.Replace);
CustomResourceExtensions.cs (1)
28return builder.WithAnnotation(new ResourceSnapshotAnnotation(initialSnapshot), ResourceAnnotationMutationBehavior.Replace);
DistributedApplicationResourceBuilder.cs (5)
14public IResourceBuilder<T> WithAnnotation<TAnnotation>(TAnnotation annotation, ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation 20if (behavior != ResourceAnnotationMutationBehavior.Append && behavior != ResourceAnnotationMutationBehavior.Replace) 27if (behavior == ResourceAnnotationMutationBehavior.Replace && Resource.Annotations.OfType<TAnnotation>().SingleOrDefault() is { } existingAnnotation)
DotnetProgramResourceBuilderExtensions.cs (1)
44return builder.WithAnnotation<DisableForwardedHeadersAnnotation>(ResourceAnnotationMutationBehavior.Replace);
ProjectResourceBuilderExtensions.cs (1)
1014builder.WithAnnotation<DisableForwardedHeadersAnnotation>(ResourceAnnotationMutationBehavior.Replace);
ResourceBuilderExtensions.cs (20)
148}, ResourceAnnotationMutationBehavior.Replace); 202}, ResourceAnnotationMutationBehavior.Replace); 220}, ResourceAnnotationMutationBehavior.Replace); 1015return builder.WithAnnotation(new ManifestPublishingCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 1033return builder.WithAnnotation(new ManifestPublishingCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 1051return builder.WithAnnotation(new ConnectionStringRedirectAnnotation(resource), ResourceAnnotationMutationBehavior.Replace); 2011builder.WithAnnotation(new ProxySupportAnnotation { ProxyEnabled = proxyEnabled }, ResourceAnnotationMutationBehavior.Replace); 4402return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4453return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4504return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4541return builder.WithAnnotation(new CertificateTrustConfigurationCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 4613return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4649return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4681return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4715return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Append); 5161return builder.WithAnnotation(new ResourceTypeDisplayNameAnnotation(resourceTypeDisplayName), ResourceAnnotationMutationBehavior.Replace); 5200return builder.WithAnnotation(new ResourceIconAnnotation(iconName, iconVariant), ResourceAnnotationMutationBehavior.Replace); 5679return builder.WithAnnotation(new HiddenAnnotation(HiddenBehavior.Always), ResourceAnnotationMutationBehavior.Replace); 5699return builder.WithAnnotation(new HiddenAnnotation(HiddenBehavior.OnCompletion) { SuccessfulExitCodes = [exitCode] }, ResourceAnnotationMutationBehavior.Replace); 5750return builder.WithAnnotation(new HiddenAnnotation(HiddenBehavior.OnCompletion) { SuccessfulExitCodes = exitCodes.Count > 0 ? [.. exitCodes] : [0] }, ResourceAnnotationMutationBehavior.Replace);
ResourceTraitBuilderExtensions.cs (1)
77builder.WithAnnotation(new DisplayOrderAnnotation(order), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.ApiManagement (1)
AzureApiManagementExtensions.cs (1)
153builder.WithAnnotation(new AppIdentityAnnotation(identityResourceBuilder.Resource), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
438return builder.WithAnnotation(new ConfigFileAnnotation(path), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.Functions (3)
AzureFunctionsProjectResourceExtensions.cs (3)
240.WithAnnotation(new AzureFunctionsHostStorageAnnotation(storage), ResourceAnnotationMutationBehavior.Replace) 292.WithAnnotation(new AzureFunctionsHostStorageAnnotation(storage), ResourceAnnotationMutationBehavior.Replace); 540return builder.WithAnnotation(new AzureFunctionsHostStorageAnnotation(storage), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.Kubernetes (2)
AzureKubernetesEnvironmentExtensions.cs (2)
455builder.WithAnnotation(new AksSubnetAnnotation(subnet.Resource.Id), ResourceAnnotationMutationBehavior.Replace); 532ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.Network (1)
AzureVirtualNetworkExtensions.cs (1)
344ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.Sandboxes (2)
AzureSandboxesExtensions.cs (2)
174ResourceAnnotationMutationBehavior.Replace); 295ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.ServiceBus (2)
AzureServiceBusExtensions.cs (2)
568return builder.WithAnnotation(new ConfigFileAnnotation(path), ResourceAnnotationMutationBehavior.Replace); 732return builder.WithAnnotation(new SqlServerConnectionAnnotation(sqlServer.Resource, waitAnnotations), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.Sql (3)
AzureSqlServerResource.cs (3)
734public IResourceBuilder<T> WithAnnotation<TAnnotation>(TAnnotation annotation, ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation 739if (behavior == ResourceAnnotationMutationBehavior.Replace
Aspire.Hosting.Azure.Tests (4)
AzureCosmosDBExtensionsTests.cs (4)
801}, ResourceAnnotationMutationBehavior.Replace); 833}, ResourceAnnotationMutationBehavior.Replace); 862}, ResourceAnnotationMutationBehavior.Replace); 892}, ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Garnet (1)
GarnetBuilderExtensions.cs (1)
311return builder.WithAnnotation(new PersistenceAnnotation(interval), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Go (9)
GoHostingExtensions.cs (9)
312rb.WithAnnotation(new GoPackagePathAnnotation(packagePath), ResourceAnnotationMutationBehavior.Replace); 317rb.WithAnnotation(new GoBuildTagsAnnotation(buildTags), ResourceAnnotationMutationBehavior.Replace); 322rb.WithAnnotation(new GoLdFlagsAnnotation(ldFlags), ResourceAnnotationMutationBehavior.Replace); 327rb.WithAnnotation(new GoGcFlagsAnnotation(gcFlags), ResourceAnnotationMutationBehavior.Replace); 332rb.WithAnnotation(new GoRaceDetectorAnnotation(), ResourceAnnotationMutationBehavior.Replace); 377return builder.WithAnnotation(new GoAppArgsAnnotation(args), ResourceAnnotationMutationBehavior.Replace); 629ResourceAnnotationMutationBehavior.Replace); 749ResourceAnnotationMutationBehavior.Replace) 758ResourceAnnotationMutationBehavior.Replace)
Aspire.Hosting.Java (12)
JavaHostingExtensions.cs (12)
201ResourceAnnotationMutationBehavior.Replace); 412.WithAnnotation(new JavaQuarkusAnnotation(), ResourceAnnotationMutationBehavior.Replace) 556ResourceAnnotationMutationBehavior.Replace); 572ResourceAnnotationMutationBehavior.Replace); 579ResourceAnnotationMutationBehavior.Replace); 711ResourceAnnotationMutationBehavior.Replace); 833ResourceAnnotationMutationBehavior.Replace); 927ResourceAnnotationMutationBehavior.Replace); 955builder.WithAnnotation(new WrapperAnnotation(resolvedWrapperPath), ResourceAnnotationMutationBehavior.Replace); 1008return builder.WithAnnotation(new JavaMainClassAnnotation(mainClass), ResourceAnnotationMutationBehavior.Replace); 1039return builder.WithAnnotation(new JavaJarArtifactAnnotation(jarPath), ResourceAnnotationMutationBehavior.Replace); 1216builder.WithAnnotation(new JavaOtelAgentAnnotation(agentPath), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Keycloak.Tests (1)
KeycloakResourceBuilderTests.cs (1)
75}, ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Kubernetes (10)
HelmChartOptions.cs (10)
47EnvironmentBuilder.WithAnnotation(new KubernetesNamespaceAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 62EnvironmentBuilder.WithAnnotation(new KubernetesNamespaceAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 94EnvironmentBuilder.WithAnnotation(new HelmReleaseNameAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 109EnvironmentBuilder.WithAnnotation(new HelmReleaseNameAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 146EnvironmentBuilder.WithAnnotation(new HelmChartVersionAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 161EnvironmentBuilder.WithAnnotation(new HelmChartVersionAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 193EnvironmentBuilder.WithAnnotation(new HelmChartNameAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 208EnvironmentBuilder.WithAnnotation(new HelmChartNameAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 240EnvironmentBuilder.WithAnnotation(new HelmChartDescriptionAnnotation(expression), ResourceAnnotationMutationBehavior.Replace); 255EnvironmentBuilder.WithAnnotation(new HelmChartDescriptionAnnotation(expression), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Maui (1)
MauiPlatformHelper.cs (1)
165resourceBuilder.WithAnnotation(new UnsupportedPlatformAnnotation(reason), ResourceAnnotationMutationBehavior.Append);
Aspire.Hosting.MongoDB (2)
MongoDBBuilderExtensions.cs (2)
675return builder.WithAnnotation(new MongoDBServerTlsModeAnnotation(mode), ResourceAnnotationMutationBehavior.Replace); 710return builder.WithAnnotation(new MongoDBServerTlsAllowInvalidCertificatesAnnotation(), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Orleans (1)
OrleansServiceExtensions.cs (1)
392return builder.WithAnnotation(new OrleansProviderTypeAnnotation(providerType), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Python (5)
PythonAppResourceBuilderExtensions.cs (5)
1125ResourceAnnotationMutationBehavior.Replace); 1233.WithAnnotation(new PythonPackageManagerAnnotation(virtualEnvironment.GetExecutable("pip")), ResourceAnnotationMutationBehavior.Replace) 1234.WithAnnotation(new PythonInstallCommandAnnotation([.. baseInstallArgs, .. installArgs ?? []]), ResourceAnnotationMutationBehavior.Replace); 1302.WithAnnotation(new PythonPackageManagerAnnotation("uv"), ResourceAnnotationMutationBehavior.Replace) 1303.WithAnnotation(new PythonInstallCommandAnnotation(args), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
612new PersistenceAnnotation(interval, keysChangedThreshold), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.RemoteHost.Tests (2)
CapabilityDispatcherTests.cs (2)
3051public IResourceBuilder<T> WithAnnotation<TAnnotation>(TAnnotation annotation, ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation
Aspire.Hosting.Rust (2)
RustHostingExtensions.cs (2)
755ResourceAnnotationMutationBehavior.Replace); 767ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Rust.Tests (1)
AddRustAppPublishTests.cs (1)
284ResourceAnnotationMutationBehavior.Replace));
Aspire.Hosting.Tests (4)
ProjectResourceBuilderExtensionTests.cs (3)
127[InlineData(ResourceAnnotationMutationBehavior.Append, "more than one")] 128[InlineData(ResourceAnnotationMutationBehavior.Replace, "replaced")] 130ResourceAnnotationMutationBehavior mutationBehavior,
Utils\WithAnnotationTests.cs (1)
45redis.WithAnnotation<DummyAnnotation>(ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
347new PersistenceAnnotation(interval, keysChangedThreshold), ResourceAnnotationMutationBehavior.Replace);