1 instantiation of ResourceAnnotationMutationBehavior
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
1755return builder.WithAnnotation<SuppressPublishValidationAnnotation>(new());
113 references to ResourceAnnotationMutationBehavior
Aspire.Hosting (50)
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)
552return builder.WithAnnotation(new ContainerBuildOptionsCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Append); 572return builder.WithAnnotation(new ContainerBuildOptionsCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Append);
ContainerResourceBuilderExtensions.cs (17)
96}), ResourceAnnotationMutationBehavior.Replace); 105}), ResourceAnnotationMutationBehavior.Append); 600}, ResourceAnnotationMutationBehavior.Replace) 601.WithAnnotation(new ContainerLifetimeAnnotation { Lifetime = lifetime }, ResourceAnnotationMutationBehavior.Replace); 617return builder.WithAnnotation(new ContainerImagePullPolicyAnnotation { ImagePullPolicy = pullPolicy }, ResourceAnnotationMutationBehavior.Replace); 725return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 730return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 875return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 876.WithAnnotation(defaultContainerBuildOptions, ResourceAnnotationMutationBehavior.Append) 880return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 881.WithAnnotation(defaultContainerBuildOptions, ResourceAnnotationMutationBehavior.Append) 1111return builder.WithAnnotation(new ContainerNameAnnotation { Name = name }, ResourceAnnotationMutationBehavior.Replace); 1317}, ResourceAnnotationMutationBehavior.Replace); 1404return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Append); 1476return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Append); 1519return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Append); 1857}, 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)
ProjectResourceBuilderExtensions.cs (1)
931builder.WithAnnotation<DisableForwardedHeadersAnnotation>(ResourceAnnotationMutationBehavior.Replace);
ResourceBuilderExtensions.cs (19)
132}, ResourceAnnotationMutationBehavior.Replace); 186}, ResourceAnnotationMutationBehavior.Replace); 204}, ResourceAnnotationMutationBehavior.Replace); 764return builder.WithAnnotation(new ManifestPublishingCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 782return builder.WithAnnotation(new ManifestPublishingCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 800return builder.WithAnnotation(new ConnectionStringRedirectAnnotation(resource), ResourceAnnotationMutationBehavior.Replace); 1699builder.WithAnnotation(new ProxySupportAnnotation { ProxyEnabled = proxyEnabled }, ResourceAnnotationMutationBehavior.Replace); 4011return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4062return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4113return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4150return builder.WithAnnotation(new CertificateTrustConfigurationCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 4185return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4221return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4253return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace); 4287return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Append); 4739return builder.WithAnnotation(new ResourceIconAnnotation(iconName, iconVariant), ResourceAnnotationMutationBehavior.Replace); 5143return builder.WithAnnotation(new HiddenAnnotation(HiddenBehavior.Always), ResourceAnnotationMutationBehavior.Replace); 5163return builder.WithAnnotation(new HiddenAnnotation(HiddenBehavior.OnCompletion) { SuccessfulExitCodes = [exitCode] }, ResourceAnnotationMutationBehavior.Replace); 5214return builder.WithAnnotation(new HiddenAnnotation(HiddenBehavior.OnCompletion) { SuccessfulExitCodes = exitCodes.Count > 0 ? [.. exitCodes] : [0] }, ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
438return builder.WithAnnotation(new ConfigFileAnnotation(path), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.Kubernetes (2)
AzureKubernetesEnvironmentExtensions.cs (2)
264builder.WithAnnotation(new AksSubnetAnnotation(subnet.Resource.Id), ResourceAnnotationMutationBehavior.Replace); 341ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.Network (1)
AzureVirtualNetworkExtensions.cs (1)
344ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
532return builder.WithAnnotation(new ConfigFileAnnotation(path), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Azure.Sql (3)
AzureSqlServerResource.cs (3)
731public IResourceBuilder<T> WithAnnotation<TAnnotation>(TAnnotation annotation, ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation 736if (behavior == ResourceAnnotationMutationBehavior.Replace
Aspire.Hosting.Azure.Tests (4)
AzureCosmosDBExtensionsTests.cs (4)
785}, ResourceAnnotationMutationBehavior.Replace); 817}, ResourceAnnotationMutationBehavior.Replace); 846}, ResourceAnnotationMutationBehavior.Replace); 876}, ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Garnet (1)
GarnetBuilderExtensions.cs (1)
311return builder.WithAnnotation(new PersistenceAnnotation(interval), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Go (9)
GoHostingExtensions.cs (9)
290rb.WithAnnotation(new GoPackagePathAnnotation(packagePath), ResourceAnnotationMutationBehavior.Replace); 295rb.WithAnnotation(new GoBuildTagsAnnotation(buildTags), ResourceAnnotationMutationBehavior.Replace); 300rb.WithAnnotation(new GoLdFlagsAnnotation(ldFlags), ResourceAnnotationMutationBehavior.Replace); 305rb.WithAnnotation(new GoGcFlagsAnnotation(gcFlags), ResourceAnnotationMutationBehavior.Replace); 310rb.WithAnnotation(new GoRaceDetectorAnnotation(), ResourceAnnotationMutationBehavior.Replace); 345return builder.WithAnnotation(new GoAppArgsAnnotation(args), ResourceAnnotationMutationBehavior.Replace); 596ResourceAnnotationMutationBehavior.Replace); 716ResourceAnnotationMutationBehavior.Replace) 725ResourceAnnotationMutationBehavior.Replace)
Aspire.Hosting.Java (12)
JavaHostingExtensions.cs (12)
204ResourceAnnotationMutationBehavior.Replace); 415.WithAnnotation(new JavaQuarkusAnnotation(), ResourceAnnotationMutationBehavior.Replace) 559ResourceAnnotationMutationBehavior.Replace); 575ResourceAnnotationMutationBehavior.Replace); 582ResourceAnnotationMutationBehavior.Replace); 714ResourceAnnotationMutationBehavior.Replace); 836ResourceAnnotationMutationBehavior.Replace); 930ResourceAnnotationMutationBehavior.Replace); 958builder.WithAnnotation(new WrapperAnnotation(resolvedWrapperPath), ResourceAnnotationMutationBehavior.Replace); 1011return builder.WithAnnotation(new JavaMainClassAnnotation(mainClass), ResourceAnnotationMutationBehavior.Replace); 1042return builder.WithAnnotation(new JavaJarArtifactAnnotation(jarPath), ResourceAnnotationMutationBehavior.Replace); 1219builder.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)
155resourceBuilder.WithAnnotation(new UnsupportedPlatformAnnotation(reason), ResourceAnnotationMutationBehavior.Append);
Aspire.Hosting.Orleans (1)
OrleansServiceExtensions.cs (1)
392return builder.WithAnnotation(new OrleansProviderTypeAnnotation(providerType), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Python (5)
PythonAppResourceBuilderExtensions.cs (5)
1066ResourceAnnotationMutationBehavior.Replace); 1174.WithAnnotation(new PythonPackageManagerAnnotation(virtualEnvironment.GetExecutable("pip")), ResourceAnnotationMutationBehavior.Replace) 1175.WithAnnotation(new PythonInstallCommandAnnotation([.. baseInstallArgs, .. installArgs ?? []]), ResourceAnnotationMutationBehavior.Replace); 1243.WithAnnotation(new PythonPackageManagerAnnotation("uv"), ResourceAnnotationMutationBehavior.Replace) 1244.WithAnnotation(new PythonInstallCommandAnnotation(args), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
526new PersistenceAnnotation(interval, keysChangedThreshold), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.RemoteHost.Tests (2)
CapabilityDispatcherTests.cs (2)
2631public IResourceBuilder<T> WithAnnotation<TAnnotation>(TAnnotation annotation, ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation
Aspire.Hosting.Rust (2)
RustHostingExtensions.cs (2)
758ResourceAnnotationMutationBehavior.Replace); 770ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Rust.Tests (1)
AddRustAppPublishTests.cs (1)
286ResourceAnnotationMutationBehavior.Replace));
Aspire.Hosting.Tests (4)
ProjectResourceBuilderExtensionTests.cs (3)
126[InlineData(ResourceAnnotationMutationBehavior.Append, "more than one")] 127[InlineData(ResourceAnnotationMutationBehavior.Replace, "replaced")] 129ResourceAnnotationMutationBehavior mutationBehavior,
Utils\WithAnnotationTests.cs (1)
45redis.WithAnnotation<DummyAnnotation>(ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
297new PersistenceAnnotation(interval, keysChangedThreshold), ResourceAnnotationMutationBehavior.Replace);