5 instantiations of ResourceCommandAnnotation
Aspire.Hosting (5)
ApplicationModel\CommandsConfigurationExtensions.cs (3)
19resource.Annotations.Add(new ResourceCommandAnnotation( 52resource.Annotations.Add(new ResourceCommandAnnotation( 85resource.Annotations.Add(new ResourceCommandAnnotation(
ResourceBuilderExtensions.cs (2)
1429return builder.WithAnnotation(new ResourceCommandAnnotation(name, displayName, commandOptions.UpdateState ?? (c => ResourceCommandState.Enabled), executeCommand, commandOptions.Description, commandOptions.Parameter, commandOptions.ConfirmationMessage, commandOptions.IconName, commandOptions.IconVariant, commandOptions.IsHighlighted)); 1494return builder.WithAnnotation(new ResourceCommandAnnotation(name, displayName, updateState ?? (c => ResourceCommandState.Enabled), executeCommand, displayDescription, parameter, confirmationMessage, iconName, iconVariant, isHighlighted));
43 references to ResourceCommandAnnotation
Aspire.Hosting (16)
ApplicationModel\ResourceCommandAnnotation.cs (4)
15/// Initializes a new instance of the <see cref="ResourceCommandAnnotation"/> class. 141/// The result of executing a command. Returned from <see cref="ResourceCommandAnnotation.ExecuteCommand"/>. 157/// Context for <see cref="ResourceCommandAnnotation.UpdateState"/>. 173/// Context for <see cref="ResourceCommandAnnotation.ExecuteCommand"/>.
ApplicationModel\ResourceNotificationService.cs (3)
590foreach (var annotation in resource.Annotations.OfType<ResourceCommandAnnotation>()) 649static ResourceCommandSnapshot CreateCommandFromAnnotation(ResourceCommandAnnotation annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider)
Dashboard\DashboardCommandExecutor.cs (1)
22public async Task<ExecuteCommandResult> ExecuteCommandAsync(string resourceId, ResourceCommandAnnotation annotation, CancellationToken cancellationToken)
Dashboard\DashboardServiceData.cs (2)
96var annotation = resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => a.Name == type);
ResourceBuilderExtensions.cs (6)
1390/// Adds a <see cref="ResourceCommandAnnotation"/> to the resource annotations to add a resource command. 1423var existingAnnotation = builder.Resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => a.Name == name); 1433/// Adds a <see cref="ResourceCommandAnnotation"/> to the resource annotations to add a resource command. 1488var existingAnnotation = builder.Resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => a.Name == name);
Aspire.Hosting.Tests (27)
Dashboard\DashboardLifecycleHookTests.cs (1)
97Assert.Empty(dashboardResource.Annotations.OfType<ResourceCommandAnnotation>());
Dcp\DcpExecutorTests.cs (1)
1236var commandAnnotations = resource.Annotations.OfType<ResourceCommandAnnotation>().ToList();
ResourceCommandAnnotationTests.cs (2)
53var startCommand = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == commandName);
WithHttpCommandTests.cs (23)
89var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().FirstOrDefault(); 122var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().FirstOrDefault(); 152var commands = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 153var command1 = commands.FirstOrDefault(c => c.DisplayName == "Do The Thing"); 154var command2 = commands.FirstOrDefault(c => c.DisplayName == "Do The Thing" && c.Name.Contains("custom-endpoint")); 155var command3 = commands.FirstOrDefault(c => c.DisplayName == "Do The Get Thing"); 156var command4 = commands.FirstOrDefault(c => c.DisplayName == "Do The Get Thing" && c.Name.Contains("custom-endpoint")); 157var command5 = commands.FirstOrDefault(c => c.DisplayName == "Do The Other Thing"); 158var command6 = commands.FirstOrDefault(c => c.DisplayName == "Do The Other Thing CHANGED"); 184var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().First(c => c.Name == "mycommand"); 214var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().First(c => c.Name == "mycommand"); 243var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().First(c => c.Name == "mycommand"); 288var command = serviceB.Resource.Annotations.OfType<ResourceCommandAnnotation>().First(c => c.Name == "mycommand"); 331var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().First(c => c.Name == "mycommand"); 375var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().First(c => c.Name == "mycommand");