1 implementation of WithAnnotation
Aspire.Hosting (1)
DistributedApplicationResourceBuilder.cs (1)
14public IResourceBuilder<T> WithAnnotation<TAnnotation>(TAnnotation annotation, ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation
154 references to WithAnnotation
Aspire.Hosting (45)
ApplicationModel\IResourceBuilder.cs (1)
29IResourceBuilder<T> WithAnnotation<TAnnotation>(ResourceAnnotationMutationBehavior behavior = ResourceAnnotationMutationBehavior.Append) where TAnnotation : IResourceAnnotation, new() => WithAnnotation(new TAnnotation(), behavior);
ContainerResourceBuilderExtensions.cs (9)
86return builder.WithAnnotation(annotation); 126return builder.WithAnnotation(annotation); 184return builder.WithAnnotation(annotation); 379return builder.WithAnnotation(annotation); 406return builder.WithAnnotation(new ContainerLifetimeAnnotation { Lifetime = lifetime }, ResourceAnnotationMutationBehavior.Replace); 420return builder.WithAnnotation(new ContainerImagePullPolicyAnnotation { ImagePullPolicy = pullPolicy }, ResourceAnnotationMutationBehavior.Replace); 491return builder.WithAnnotation(annotation, ResourceAnnotationMutationBehavior.Replace) 556return builder.WithAnnotation(new ContainerNameAnnotation { Name = name }, ResourceAnnotationMutationBehavior.Replace); 909builder.WithAnnotation(new ProxySupportAnnotation { ProxyEnabled = proxyEnabled }, ResourceAnnotationMutationBehavior.Replace);
CustomResourceExtensions.cs (1)
26return builder.WithAnnotation(new ResourceSnapshotAnnotation(initialSnapshot), ResourceAnnotationMutationBehavior.Replace);
ProjectResourceBuilderExtensions.cs (6)
239.WithAnnotation(new TProject()) 283.WithAnnotation(new ProjectMetadata(projectPath)) 325builder.WithAnnotation(new ExcludeLaunchProfileAnnotation()); 329builder.WithAnnotation(new LaunchProfileAnnotation(options.LaunchProfileName)); 337builder.WithAnnotation(new DefaultLaunchProfileAnnotation(appHostDefaultLaunchProfileName)); 601builder.WithAnnotation(new ReplicaAnnotation(replicas));
ResourceBuilderExtensions.cs (28)
38return builder.WithAnnotation(new EnvironmentAnnotation(name, value ?? string.Empty)); 102return builder.WithAnnotation(new EnvironmentCallbackAnnotation(name, callback)); 117return builder.WithAnnotation(new EnvironmentCallbackAnnotation(callback)); 132return builder.WithAnnotation(new EnvironmentCallbackAnnotation(callback)); 297return builder.WithAnnotation(new CommandLineArgsCallbackAnnotation(callback)); 313return builder.WithAnnotation(new ManifestPublishingCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 330return builder.WithAnnotation(new PublishingCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 346return builder.WithAnnotation(new ManifestPublishingCallbackAnnotation(callback), ResourceAnnotationMutationBehavior.Replace); 362return builder.WithAnnotation(new ConnectionStringRedirectAnnotation(resource), ResourceAnnotationMutationBehavior.Replace); 504builder.WithAnnotation(endpointReferenceAnnotation); 626builder.WithAnnotation(new EnvironmentCallbackAnnotation(context => 632return builder.WithAnnotation(annotation); 746return builder.WithAnnotation(new Http2ServiceAnnotation()); 802return builder.WithAnnotation(new ResourceUrlsCallbackAnnotation(callback)); 825return builder.WithAnnotation(new ResourceUrlsCallbackAnnotation(callback)); 846return builder.WithAnnotation(new ResourceUrlAnnotation { Url = url, DisplayText = displayText }); 889return builder.WithAnnotation(new ResourceUrlsCallbackAnnotation(async c => 1014return builder.WithAnnotation(ManifestPublishingCallbackAnnotation.Ignore); 1132return builder.WithAnnotation(new WaitAnnotation(dependency.Resource, WaitType.WaitUntilHealthy) { WaitBehavior = waitBehavior }); 1158return builder.WithAnnotation(new ExplicitStartupAnnotation()); 1204return builder.WithAnnotation(new WaitAnnotation(dependency.Resource, WaitType.WaitForCompletion, exitCode)); 1253builder.WithAnnotation(new HealthCheckAnnotation(key)); 1458return builder.WithAnnotation(new ResourceCommandAnnotation(name, displayName, commandOptions.UpdateState ?? (c => ResourceCommandState.Enabled), executeCommand, commandOptions.Description, commandOptions.Parameter, commandOptions.ConfirmationMessage, commandOptions.IconName, commandOptions.IconVariant, commandOptions.IsHighlighted)); 1523return builder.WithAnnotation(new ResourceCommandAnnotation(name, displayName, updateState ?? (c => ResourceCommandState.Enabled), executeCommand, displayDescription, parameter, confirmationMessage, iconName, iconVariant, isHighlighted)); 1859return builder.WithAnnotation(new ResourceRelationshipAnnotation(resource, type)); 1876return builder.WithAnnotation(new ResourceRelationshipAnnotation(resource, KnownRelationshipTypes.Reference)); 1952return builder.WithAnnotation(new ResourceRelationshipAnnotation(resourceBuilder.Resource, KnownRelationshipTypes.Reference)); 2031builder.WithAnnotation(new ComputeEnvironmentAnnotation(computeEnvironmentResource.Resource));
Aspire.Hosting.Azure (6)
AzureUserAssignedIdentityExtensions.cs (1)
69builder.WithAnnotation(new AppIdentityAnnotation(identityResourceBuilder.Resource));
ExistingAzureResourceExtensions.cs (5)
42builder.WithAnnotation(new ExistingAzureResourceAnnotation(nameParameter.Resource, resourceGroupParameter?.Resource)); 63builder.WithAnnotation(new ExistingAzureResourceAnnotation(name, resourceGroup)); 84builder.WithAnnotation(new ExistingAzureResourceAnnotation(nameParameter.Resource, resourceGroupParameter?.Resource)); 105builder.WithAnnotation(new ExistingAzureResourceAnnotation(name, resourceGroup)); 124builder.WithAnnotation(new ExistingAzureResourceAnnotation(nameParameter.Resource, resourceGroupParameter?.Resource));
Aspire.Hosting.Azure.AIFoundry (2)
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.AppConfiguration (2)
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.AppContainers (4)
AzureContainerAppContainerExtensions.cs (1)
47container.WithAnnotation(new AzureContainerAppCustomizationAnnotation(configure));
AzureContainerAppExecutableExtensions.cs (1)
47return executable.WithAnnotation(new AzureContainerAppCustomizationAnnotation(configure));
AzureContainerAppExtensions.cs (1)
382builder.WithAnnotation(new AzureLogAnalyticsWorkspaceReferenceAnnotation(workspaceBuilder.Resource));
AzureContainerAppProjectExtensions.cs (1)
47project.WithAnnotation(new AzureContainerAppCustomizationAnnotation(configure));
Aspire.Hosting.Azure.ApplicationInsights (1)
AzureApplicationInsightsExtensions.cs (1)
131return builder.WithAnnotation(new LogAnalyticsWorkspaceReferenceAnnotation(workspaceId));
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceComputeResourceExtensions.cs (1)
47return builder.WithAnnotation(new AzureAppServiceWebsiteCustomizationAnnotation(configure));
Aspire.Hosting.Azure.CognitiveServices (2)
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.ContainerRegistry (4)
AzureContainerRegistryExtensions.cs (2)
63.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>())); 81builder.WithAnnotation(new ContainerRegistryReferenceAnnotation(registryBuilder.Resource));
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.CosmosDB (2)
AzureCosmosDBExtensions.cs (2)
40.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>())); 83.WithAnnotation(new ContainerImageAnnotation
Aspire.Hosting.Azure.EventHubs (6)
AzureEventHubsExtensions.cs (4)
226.WithAnnotation(new ContainerImageAnnotation 258builder.WithAnnotation(new EnvironmentCallbackAnnotation((EnvironmentCallbackContext context) => 392return builder.WithAnnotation(new ConfigFileAnnotation(path), ResourceAnnotationMutationBehavior.Replace); 406builder.WithAnnotation(new ConfigJsonAnnotation(configJson));
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.Functions (4)
AzureFunctionsProjectResourceExtensions.cs (2)
93.WithAnnotation(new TProject()) 94.WithAnnotation(new AzureFunctionsAnnotation())
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.KeyVault (2)
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.PostgreSQL (2)
AzurePostgresExtensions.cs (2)
79builder.WithAnnotation(new AzureBicepResourceAnnotation(resource)); 145.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Azure.Redis (2)
AzureRedisExtensions.cs (2)
66builder.WithAnnotation(new AzureBicepResourceAnnotation(resource)); 125.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Azure.Search (2)
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.ServiceBus (6)
AzureServiceBusExtensions.cs (4)
358.WithAnnotation(new ContainerImageAnnotation 379builder.WithAnnotation(new EnvironmentCallbackAnnotation((EnvironmentCallbackContext context) => 474return builder.WithAnnotation(new ConfigFileAnnotation(path), ResourceAnnotationMutationBehavior.Replace); 504builder.WithAnnotation(new ConfigJsonAnnotation(configJson));
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.SignalR (3)
AzureSignalRExtensions.cs (1)
127.WithAnnotation(new ContainerImageAnnotation
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.Sql (2)
AzureSqlExtensions.cs (2)
38builder.WithAnnotation(new AzureBicepResourceAnnotation(resource)); 90.WithAnnotation(new DefaultRoleAssignmentsAnnotation(new HashSet<RoleDefinition>()));
Aspire.Hosting.Azure.Storage (3)
AzureStorageExtensions.cs (1)
127.WithAnnotation(new ContainerImageAnnotation
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Azure.Tests (15)
AzurePostgresExtensionsTests.cs (6)
253postgres.WithAnnotation(new Dummy1Annotation()); 254db?.WithAnnotation(new Dummy1Annotation()); 259c.WithAnnotation(new Dummy2Annotation()); 269db!.WithAnnotation(new Dummy1Annotation()); 275postgres.WithAnnotation(new Dummy1Annotation()); 276db!.WithAnnotation(new Dummy1Annotation());
AzureRedisExtensionsTests.cs (3)
154cache.WithAnnotation(new Dummy1Annotation()); 159c.WithAnnotation(new Dummy2Annotation()); 164cache.WithAnnotation(new Dummy1Annotation());
AzureSqlExtensionsTests.cs (6)
191sql.WithAnnotation(new Dummy1Annotation()); 192db?.WithAnnotation(new Dummy1Annotation()); 197c.WithAnnotation(new Dummy2Annotation()); 207db!.WithAnnotation(new Dummy1Annotation()); 213sql.WithAnnotation(new Dummy1Annotation()); 214db!.WithAnnotation(new Dummy1Annotation());
Aspire.Hosting.Azure.WebPubSub (2)
src\Shared\AzureRoleAssignmentUtils.cs (2)
15return builder.WithAnnotation(new RoleAssignmentAnnotation(target.Resource, CreateRoleDefinitions(roles, getName))); 22return builder.WithAnnotation(new DefaultRoleAssignmentsAnnotation(CreateRoleDefinitions(roles, getName)));
Aspire.Hosting.Docker (1)
DockerComposeServiceExtensions.cs (1)
49return builder.WithAnnotation(new DockerComposeServiceCustomizationAnnotation(configure));
Aspire.Hosting.Garnet (1)
GarnetBuilderExtensions.cs (1)
286return builder.WithAnnotation(new PersistenceAnnotation(interval), ResourceAnnotationMutationBehavior.Replace);
Aspire.Hosting.Kubernetes (1)
KubernetesServiceExtensions.cs (1)
48return builder.WithAnnotation(new KubernetesServiceCustomizationAnnotation(configure));
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
173builder.WithAnnotation(new MySqlCreateDatabaseScriptAnnotation(script));
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
442builder.WithAnnotation(new PostgresCreateDatabaseScriptAnnotation(script));
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
375return builder.WithAnnotation(
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
195builder.WithAnnotation(new SqlServerCreateDatabaseScriptAnnotation(script));
Aspire.Hosting.Tests (28)
PublishingTests.cs (10)
59.WithAnnotation(new DeployingCallbackAnnotation(context => 95.WithAnnotation(new DeployingCallbackAnnotation(context => 130.WithAnnotation(new DeployingCallbackAnnotation(context => 155.WithAnnotation(new DeployingCallbackAnnotation(context => 162.WithAnnotation(new DeployingCallbackAnnotation(context => 187.WithAnnotation(new DeployingCallbackAnnotation(context => 251.WithAnnotation(new DeployingCallbackAnnotation(_ => throw new InvalidOperationException("Deploy failed!"))); 264.WithAnnotation(new DeployingCallbackAnnotation(_ => { called = "first"; return Task.CompletedTask; })) 265.WithAnnotation(new DeployingCallbackAnnotation(_ => { called = "second"; return Task.CompletedTask; })); 282.WithAnnotation(new DeployingCallbackAnnotation(context =>
ResourceExtensionsTests.cs (14)
30.WithAnnotation(new AnotherDummyAnnotation()); 42.WithAnnotation(new DummyAnnotation()); 54.WithAnnotation(new DummyAnnotation()); 77.WithAnnotation(new AnotherDummyAnnotation()); 89.WithAnnotation(new AnotherDummyAnnotation()); 92.WithAnnotation(new AnotherDummyAnnotation()); 104.WithAnnotation(new DummyAnnotation()); 118.WithAnnotation(new DummyAnnotation()); 121.WithAnnotation(new DummyAnnotation()); 133.WithAnnotation(new DummyAnnotation()); 136.WithAnnotation(new DummyAnnotation()); 139.WithAnnotation(new DummyAnnotation()); 306.WithAnnotation(new DeploymentTargetAnnotation(compute1.Resource) { ComputeEnvironment = compute1.Resource }) 307.WithAnnotation(new DeploymentTargetAnnotation(compute2.Resource) { ComputeEnvironment = compute2.Resource });
Utils\WithAnnotationTests.cs (2)
29.WithAnnotation<DummyAnnotation>(new DummyAnnotation()) 30.WithAnnotation<DummyAnnotation>(new DummyAnnotation());
WaitForTests.cs (2)
637.WithAnnotation(new ReplicaAnnotation(2)) 690.WithAnnotation(new ReplicaAnnotation(2))
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
281return builder.WithAnnotation(