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