2 instantiations of ResourceCommandAnnotation
Aspire.Hosting (2)
ResourceBuilderExtensions.cs (2)
1386
return builder.WithAnnotation(new
ResourceCommandAnnotation
(name, displayName, commandOptions.UpdateState ?? (c => ResourceCommandState.Enabled), executeCommand, commandOptions.Description, commandOptions.Parameter, commandOptions.ConfirmationMessage, commandOptions.IconName, commandOptions.IconVariant, commandOptions.IsHighlighted));
1451
return builder.WithAnnotation(new
ResourceCommandAnnotation
(name, displayName, updateState ?? (c => ResourceCommandState.Enabled), executeCommand, displayDescription, parameter, confirmationMessage, iconName, iconVariant, isHighlighted));
41 references to ResourceCommandAnnotation
Aspire.Hosting (14)
ApplicationModel\ResourceCommandAnnotation.cs (3)
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"/>.
ApplicationModel\ResourceNotificationService.cs (3)
614
foreach (
var
annotation in resource.Annotations.OfType<
ResourceCommandAnnotation
>())
673
static ResourceCommandSnapshot CreateCommandFromAnnotation(
ResourceCommandAnnotation
annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider)
Dashboard\DashboardCommandExecutor.cs (1)
22
public async Task<ExecuteCommandResult> ExecuteCommandAsync(string resourceId,
ResourceCommandAnnotation
annotation, CancellationToken cancellationToken)
Dashboard\DashboardServiceData.cs (1)
94
var annotation = resource.Annotations.OfType<
ResourceCommandAnnotation
>().SingleOrDefault(a => a.Name == type);
ResourceBuilderExtensions.cs (6)
1348
/// Adds a <see cref="
ResourceCommandAnnotation
"/> to the resource annotations to add a resource command.
1380
var
existingAnnotation = builder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().SingleOrDefault(a => a.Name == name);
1390
/// Adds a <see cref="
ResourceCommandAnnotation
"/> to the resource annotations to add a resource command.
1445
var
existingAnnotation = builder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().SingleOrDefault(a => a.Name == name);
Aspire.Hosting.Tests (27)
Dashboard\DashboardLifecycleHookTests.cs (1)
96
Assert.Empty(dashboardResource.Annotations.OfType<
ResourceCommandAnnotation
>());
Dcp\DcpExecutorTests.cs (1)
1205
var commandAnnotations = resource.Annotations.OfType<
ResourceCommandAnnotation
>().ToList();
ResourceCommandAnnotationTests.cs (2)
47
var
startCommand = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().Single(a => a.Name == commandName);
WithHttpCommandTests.cs (23)
45
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().FirstOrDefault();
78
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().FirstOrDefault();
108
var commands = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().ToList();
109
var
command1 = commands.FirstOrDefault(c => c.DisplayName == "Do The Thing");
110
var
command2 = commands.FirstOrDefault(c => c.DisplayName == "Do The Thing" && c.Name.Contains("custom-endpoint"));
111
var
command3 = commands.FirstOrDefault(c => c.DisplayName == "Do The Get Thing");
112
var
command4 = commands.FirstOrDefault(c => c.DisplayName == "Do The Get Thing" && c.Name.Contains("custom-endpoint"));
113
var
command5 = commands.FirstOrDefault(c => c.DisplayName == "Do The Other Thing");
114
var
command6 = commands.FirstOrDefault(c => c.DisplayName == "Do The Other Thing CHANGED");
140
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().First(c => c.Name == "mycommand");
170
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().First(c => c.Name == "mycommand");
199
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().First(c => c.Name == "mycommand");
244
var
command = serviceB.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().First(c => c.Name == "mycommand");
287
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().First(c => c.Name == "mycommand");
331
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().First(c => c.Name == "mycommand");