12 instantiations of ResourceCommandAnnotation
Aspire.Hosting (8)
ApplicationModel\CommandsConfigurationExtensions.cs (4)
25resource.Annotations.Add(new ResourceCommandAnnotation( 58resource.Annotations.Add(new ResourceCommandAnnotation( 97resource.Annotations.Add(new ResourceCommandAnnotation( 161projectResource.Annotations.Add(new ResourceCommandAnnotation(
Orchestrator\ParameterProcessor.cs (2)
264parameterResource.Annotations.Add(new ResourceCommandAnnotation( 300parameterResource.Annotations.Add(new ResourceCommandAnnotation(
ResourceBuilderExtensions.cs (2)
2935return builder.WithAnnotation(new ResourceCommandAnnotation(name, displayName, commandOptions.UpdateState ?? (c => ResourceCommandState.Enabled), executeCommand, commandOptions.Description, commandOptions.Parameter, commandOptions.Arguments, commandOptions.ConfirmationMessage, commandOptions.IconName, commandOptions.IconVariant, commandOptions.IsHighlighted, commandOptions.Visibility, commandOptions.ValidateArguments, commandOptions.Progress)); 3001return builder.WithAnnotation(new ResourceCommandAnnotation(name, displayName, updateState ?? (c => ResourceCommandState.Enabled), executeCommand, displayDescription, parameter, confirmationMessage, iconName, iconVariant, isHighlighted));
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
113resource.Annotations.Add(new ResourceCommandAnnotation(
Aspire.Hosting.EntityFrameworkCore.Tests (1)
EFCoreOperationExecutorTests.cs (1)
219toolResource.Annotations.Add(new ResourceCommandAnnotation(
Aspire.Hosting.Maui (1)
Lifecycle\MauiBuildQueueEventSubscriber.cs (1)
362resource.Annotations.Add(new ResourceCommandAnnotation(
Aspire.Hosting.Maui.Tests (1)
MauiBuildQueueTests.cs (1)
743resource.Annotations.Add(new ResourceCommandAnnotation(
314 references to ResourceCommandAnnotation
Aspire.Hosting (30)
ApplicationModel\ResourceCommandAnnotation.cs (6)
17/// Initializes a new instance of the <see cref="ResourceCommandAnnotation"/> class. 35/// Initializes a new instance of the <see cref="ResourceCommandAnnotation"/> class. 292/// The result of executing a command. Returned from <see cref="ResourceCommandAnnotation.ExecuteCommand"/>. 359/// Context for <see cref="ResourceCommandAnnotation.UpdateState"/>. 439/// Context for <see cref="ResourceCommandAnnotation.ExecuteCommand"/>. 481/// The collection contains the arguments described by <see cref="ResourceCommandAnnotation.Arguments"/> with their
ApplicationModel\ResourceCommandService.cs (14)
221var annotation = ResolveCommandAnnotation(resourceEvent.Resource, ref resolvedCommandName); 233var annotation = ResolveCommandAnnotation(resource, ref resolvedCommandName); 242private static (InteractionInputCollection Arguments, string? ErrorMessage) CreateCommandArguments(ResourceCommandAnnotation annotation, string resolvedCommandName, IReadOnlyDictionary<string, string?>? argumentValues) 279var annotation = ResolveCommandAnnotation(resourceEvent.Resource, ref resolvedCommandName); 332var annotation = ResolveCommandAnnotation(resource, ref commandName, logger); 414ResourceCommandAnnotation annotation, 478var annotation = ResolveCommandAnnotation(resourceEvent.Resource, ref resolvedCommandName); 529private static ResourceCommandAnnotation? ResolveCommandAnnotation(IResource resource, ref string commandName, ILogger? logger = null) 532var annotation = resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => string.Equals(a.Name, requestedCommandName, StringComparisons.CommandName)); 539annotation = resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => string.Equals(a.Name, mappedName, StringComparisons.CommandName)); 572private async Task<bool> ValidateArgumentsAsync(ResourceCommandAnnotation annotation, InteractionInputCollection arguments, HashSet<string>? loadedDynamicArgumentNames, CancellationToken cancellationToken) 698private async Task<(InteractionInputCollection? Arguments, ExecuteCommandResult? Result)> PromptForCommandArgumentsAsync(ResourceCommandAnnotation annotation, InteractionInputCollection arguments, CancellationToken cancellationToken) 772private static InteractionInputCollection NormalizeCommandArguments(ResourceCommandAnnotation annotation, InteractionInputCollection arguments)
ApplicationModel\ResourceNotificationService.cs (3)
1094foreach (var annotation in resource.Annotations.OfType<ResourceCommandAnnotation>()) 1153static ResourceCommandSnapshot CreateCommandFromAnnotation(ResourceCommandAnnotation annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider)
Orchestrator\ParameterProcessor.cs (1)
155if (executionContext.IsRunMode && interactionService.IsAvailable && !parameterResource.Annotations.OfType<ResourceCommandAnnotation>().Any(a => a.Name.Equals(KnownResourceCommands.SetParameterCommand, StringComparisons.CommandName)))
ResourceBuilderExtensions.cs (6)
2891/// Adds a <see cref="ResourceCommandAnnotation"/> to the resource annotations to add a resource command. 2928var existingAnnotation = builder.Resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => a.Name == name); 2940/// Adds a <see cref="ResourceCommandAnnotation"/> to the resource annotations to add a resource command. 2995var existingAnnotation = builder.Resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(a => a.Name == name);
Aspire.Hosting.Azure (1)
AzureResourcePreparer.cs (1)
108if (resource.Annotations.OfType<ResourceCommandAnnotation>().SingleOrDefault(annotation => annotation.Name == name) is { } existingAnnotation)
Aspire.Hosting.Azure.Tests (144)
AzureEnvironmentResourceExtensionsTests.cs (144)
74var resetCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ResetProvisioningStateCommandName); 88var commands = environmentResource.Annotations.OfType<ResourceCommandAnnotation>().ToArray(); 121var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 185var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 242var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 286var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 354var resetCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ResetProvisioningStateCommandName); 408var resetCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ResetProvisioningStateCommandName); 657Assert.Contains(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ForgetStateCommandName); 658var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 675Assert.Contains(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 676var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 677var deleteCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 678var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 682Assert.DoesNotContain(blobs.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => 746var changeLocationCommand = Assert.Single(postgres.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 827var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 911var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1180var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1244var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1305var getResourceCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.GetAzureResourceCommandName); 1366var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 1501var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 1559var command = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == commandName); 1611var queuedReprovisionCommand = Assert.Single(storage2.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 1623var conflictingCommand = Assert.Single(storage2.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 1706var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 1790var deleteCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 1884var deleteCommand = Assert.Single(keyVault.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 1955var deleteCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 2032var deleteCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourceCommandName); 2033var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2112var forgetCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ForgetStateCommandName); 2176var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2230var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2290var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2366var reprovisionStorageCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2367var reprovisionStorage2Command = Assert.Single(storage2.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2443var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2444var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2542var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2588var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2640var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 2641var cancelCommand = Assert.Single(storage2.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName); 2708var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 2781var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 2834var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 2894var changeLocationCommand = Assert.Single(visibleResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 2949var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3026var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3086var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3155var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3212var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3275var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3347var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 3401var reprovisionAllCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionAllCommandName); 3441var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 3515var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 3563var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 3619var changeContextCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeAzureContextCommandName); 3766var reprovisionCommand = Assert.Single(storage2.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 3845var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 3917var reprovisionCommand = Assert.Single(keyVault.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 3997var reprovisionCommand = Assert.Single(keyVault.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4071var reprovisionCommand = Assert.Single(postgres.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4123var changeLocationCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 4169var changeLocationCommand = Assert.Single(keyVault.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ChangeResourceLocationCommandName); 4215var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4281var reprovisionCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.ReprovisionResourceCommandName); 4522var deleteCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourcesCommandName); 4574var deleteCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourcesCommandName); 4621var deleteCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourcesCommandName); 4669var deleteCommand = Assert.Single(environmentResource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.DeleteAzureResourcesCommandName); 4808var cancelCommand = Assert.Single(storage.Resource.Annotations.OfType<ResourceCommandAnnotation>(), c => c.Name == AzureProvisioningController.CancelCommandName);
Aspire.Hosting.Blazor.Tests (13)
BlazorHostedExtensionsTests.cs (5)
182.OfType<ResourceCommandAnnotation>() 213var debugCommand = Assert.Single( 214host.Resource.Annotations.OfType<ResourceCommandAnnotation>(), 239var debugCommand = Assert.Single( 240host.Resource.Annotations.OfType<ResourceCommandAnnotation>(),
WithBlazorAppTests.cs (8)
209.OfType<ResourceCommandAnnotation>() 214Assert.DoesNotContain(gateway.Resource.Annotations, annotation => annotation is ResourceCommandAnnotation); 231Assert.DoesNotContain(wasmApp.Resource.Annotations, annotation => annotation is ResourceCommandAnnotation); 249var commands = wasmApp.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToDictionary(annotation => annotation.Name); 288var command = Assert.Single( 289wasmApp.Resource.Annotations.OfType<ResourceCommandAnnotation>(), 315var command = Assert.Single( 316wasmApp.Resource.Annotations.OfType<ResourceCommandAnnotation>(),
Aspire.Hosting.Browsers.Tests (12)
BrowserLogsBuilderExtensionsTests.cs (12)
58var command = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.OpenTrackedBrowserCommandName); 61var configureCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.ConfigureTrackedBrowserCommandName); 64var screenshotCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.CaptureScreenshotCommandName); 100var configureCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.ConfigureTrackedBrowserCommandName); 155var configureCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.ConfigureTrackedBrowserCommandName); 191var configureCommand = Assert.Single(browserLogsResource.Annotations.OfType<ResourceCommandAnnotation>(), annotation => annotation.Name == BrowserLogsBuilderExtensions.ConfigureTrackedBrowserCommandName);
Aspire.Hosting.DevTunnels.Tests (6)
DevTunnelResourceBuilderExtensionsTests.cs (6)
428var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName); 516var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName); 564var command = Assert.Single(port.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == DevTunnelPortResource.ShowTunnelUrlsCommandName);
Aspire.Hosting.Dotnet.Tests (5)
DotnetProjectResourceTests.cs (5)
512var restartCommand = resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 526var restartCommand = resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 529Assert.Contains(resource.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == KnownResourceCommands.RebuildCommand);
Aspire.Hosting.EntityFrameworkCore (1)
EFCoreOperationExecutor.cs (1)
387if (toolResource.Annotations.OfType<ResourceCommandAnnotation>().Any(a => a.Name == KnownResourceCommands.StartCommand))
Aspire.Hosting.EntityFrameworkCore.Tests (32)
EFMigrationCommandsTests.cs (30)
20var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 21var updateCommand = commands.FirstOrDefault(c => c.Name.Contains("ef-database-update")); 34var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 35var dropCommand = commands.FirstOrDefault(c => c.Name.Contains("ef-database-drop")); 49var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 50var resetCommand = commands.FirstOrDefault(c => c.Name.Contains("ef-database-reset")); 64var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 65var addCommand = commands.FirstOrDefault(c => c.Name.Contains("ef-migrations-add")); 82var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 83var removeCommand = commands.FirstOrDefault(c => c.Name.Contains("ef-migrations-remove")); 96var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 97var statusCommand = commands.FirstOrDefault(c => c.Name.Contains("ef-database-status")); 110var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 124var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 125var updateCommand = commands.FirstOrDefault(c => c.Name == "ef-database-update"); 149var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 151foreach (var command in commands.Where(c => c.Name.Contains("ef-"))) 164var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 166var dropCommand = commands.First(c => c.Name.Contains("ef-database-drop")); 167var resetCommand = commands.First(c => c.Name.Contains("ef-database-reset")); 180var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 182var updateCommand = commands.First(c => c.Name.Contains("ef-database-update")); 183var statusCommand = commands.First(c => c.Name.Contains("ef-database-status")); 196var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 205foreach (var command in commands.Where(c => c.Name.Contains("ef-"))) 226var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 235foreach (var command in commands.Where(c => c.Name.Contains("ef-"))) 256var commands = migrations.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 266foreach (var command in commands.Where(c => c.Name.Contains("ef-"))) 286foreach (var command in commands.Where(c => c.Name.Contains("ef-")))
EFMigrationPipelineTests.cs (2)
280var startCommand = migrations.Resource.ToolResource.Annotations 281.OfType<ResourceCommandAnnotation>()
Aspire.Hosting.Foundry.Tests (10)
HostedAgentExtensionTests.cs (6)
81var command = Assert.Single(resource.Annotations.OfType<ResourceCommandAnnotation>()); 106var command = Assert.Single(resource.Annotations.OfType<ResourceCommandAnnotation>()); 136var command = Assert.Single(resource.Annotations.OfType<ResourceCommandAnnotation>());
PromptAgentTests.cs (4)
77var command = Assert.Single(resource.Annotations.OfType<ResourceCommandAnnotation>()); 98var command = Assert.Single(agent.Resource.Annotations.OfType<ResourceCommandAnnotation>());
Aspire.Hosting.Maui (2)
Lifecycle\MauiBuildQueueEventSubscriber.cs (2)
348var originalStop = resource.Annotations 349.OfType<ResourceCommandAnnotation>()
Aspire.Hosting.Maui.Tests (4)
MauiBuildQueueTests.cs (4)
561var stopCommand = env.Android.Annotations 562.OfType<ResourceCommandAnnotation>() 594var stopCommand = env.Android.Annotations 595.OfType<ResourceCommandAnnotation>()
Aspire.Hosting.Tests (54)
Dashboard\DashboardEventHandlersTests.cs (1)
199Assert.Empty(dashboardResource.Annotations.OfType<ResourceCommandAnnotation>());
Dcp\DcpExecutorTests.cs (2)
9604var commandAnnotations = resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 9613var commandAnnotations = resource.Annotations.OfType<ResourceCommandAnnotation>().ToList();
Orchestrator\ParameterProcessorTests.cs (16)
875var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 895var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 926var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 951var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 985var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1023var deleteCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1055var deleteCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>() 1083var setValueCommand = parameter.Annotations.OfType<ResourceCommandAnnotation>()
ResourceCommandAnnotationTests.cs (14)
56var startCommand = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == commandName); 83var restartCommand = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 98var restartCommand = projectResource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 113var restartCommand = csharpAppResource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RestartCommand); 137var rebuildCommand = projectResource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == commandName); 164Assert.DoesNotContain(containerResource.Resource.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == KnownResourceCommands.RebuildCommand); 165Assert.Contains(projectResource.Annotations.OfType<ResourceCommandAnnotation>(), a => a.Name == KnownResourceCommands.RebuildCommand); 174var rebuildCommand = projectResource.Annotations.OfType<ResourceCommandAnnotation>().Single(a => a.Name == KnownResourceCommands.RebuildCommand);
WithHttpCommandTests.cs (15)
205var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().FirstOrDefault(); 238var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().FirstOrDefault(); 279var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(); 315var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(); 414var commands = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().ToList(); 415var command1 = commands.FirstOrDefault(c => c.DisplayName == "Do The Thing"); 416var command2 = commands.FirstOrDefault(c => c.DisplayName == "Do The Thing" && c.Name.Contains("custom-endpoint")); 417var command3 = commands.FirstOrDefault(c => c.DisplayName == "Do The Get Thing"); 418var command4 = commands.FirstOrDefault(c => c.DisplayName == "Do The Get Thing" && c.Name.Contains("custom-endpoint")); 419var command5 = commands.FirstOrDefault(c => c.DisplayName == "Do The Other Thing"); 420var command6 = commands.FirstOrDefault(c => c.DisplayName == "Do The Other Thing CHANGED");
WithProcessCommandTests.cs (6)
71var command = resourceBuilder.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(); 111var command = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single(); 251var command = resource.Resource.Annotations.OfType<ResourceCommandAnnotation>().Single();