7 instantiations of ResourceCommandAnnotation
Aspire.Hosting (7)
ApplicationModel\CommandsConfigurationExtensions.cs (3)
19
resource.Annotations.Add(new
ResourceCommandAnnotation
(
52
resource.Annotations.Add(new
ResourceCommandAnnotation
(
85
resource.Annotations.Add(new
ResourceCommandAnnotation
(
Orchestrator\ParameterProcessor.cs (2)
197
parameterResource.Annotations.Add(new
ResourceCommandAnnotation
(
213
parameterResource.Annotations.Add(new
ResourceCommandAnnotation
(
ResourceBuilderExtensions.cs (2)
2011
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));
2076
return builder.WithAnnotation(new
ResourceCommandAnnotation
(name, displayName, updateState ?? (c => ResourceCommandState.Enabled), executeCommand, displayDescription, parameter, confirmationMessage, iconName, iconVariant, isHighlighted));
35 references to ResourceCommandAnnotation
Aspire.Hosting (16)
ApplicationModel\ResourceCommandAnnotation.cs (4)
15
/// Initializes a new instance of the <see cref="
ResourceCommandAnnotation
"/> class.
146
/// The result of executing a command. Returned from <see cref="
ResourceCommandAnnotation
.ExecuteCommand"/>.
168
/// Context for <see cref="
ResourceCommandAnnotation
.UpdateState"/>.
185
/// Context for <see cref="
ResourceCommandAnnotation
.ExecuteCommand"/>.
ApplicationModel\ResourceCommandService.cs (2)
126
var
annotation = resource.Annotations.OfType<
ResourceCommandAnnotation
>().SingleOrDefault(a => a.Name == commandName);
ApplicationModel\ResourceNotificationService.cs (3)
723
foreach (
var
annotation in resource.Annotations.OfType<
ResourceCommandAnnotation
>())
782
static ResourceCommandSnapshot CreateCommandFromAnnotation(
ResourceCommandAnnotation
annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider)
Orchestrator\ParameterProcessor.cs (1)
147
if (executionContext.IsRunMode && interactionService.IsAvailable && !parameterResource.Annotations.OfType<
ResourceCommandAnnotation
>().Any(a => a.Name == KnownResourceCommands.SetParameterCommand))
ResourceBuilderExtensions.cs (6)
1971
/// Adds a <see cref="
ResourceCommandAnnotation
"/> to the resource annotations to add a resource command.
2005
var
existingAnnotation = builder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().SingleOrDefault(a => a.Name == name);
2015
/// Adds a <see cref="
ResourceCommandAnnotation
"/> to the resource annotations to add a resource command.
2070
var
existingAnnotation = builder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().SingleOrDefault(a => a.Name == name);
Aspire.Hosting.Tests (19)
Dashboard\DashboardLifecycleHookTests.cs (1)
95
Assert.Empty(dashboardResource.Annotations.OfType<
ResourceCommandAnnotation
>());
Dcp\DcpExecutorTests.cs (1)
2180
var commandAnnotations = resource.Annotations.OfType<
ResourceCommandAnnotation
>().ToList();
Orchestrator\ParameterProcessorTests.cs (4)
863
var
setValueCommand = parameter.Annotations.OfType<
ResourceCommandAnnotation
>()
883
var
setValueCommand = parameter.Annotations.OfType<
ResourceCommandAnnotation
>()
ResourceCommandAnnotationTests.cs (2)
51
var
startCommand = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().Single(a => a.Name == commandName);
WithHttpCommandTests.cs (11)
91
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().FirstOrDefault();
124
var
command = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().FirstOrDefault();
154
var commands = resourceBuilder.Resource.Annotations.OfType<
ResourceCommandAnnotation
>().ToList();
155
var
command1 = commands.FirstOrDefault(c => c.DisplayName == "Do The Thing");
156
var
command2 = commands.FirstOrDefault(c => c.DisplayName == "Do The Thing" && c.Name.Contains("custom-endpoint"));
157
var
command3 = commands.FirstOrDefault(c => c.DisplayName == "Do The Get Thing");
158
var
command4 = commands.FirstOrDefault(c => c.DisplayName == "Do The Get Thing" && c.Name.Contains("custom-endpoint"));
159
var
command5 = commands.FirstOrDefault(c => c.DisplayName == "Do The Other Thing");
160
var
command6 = commands.FirstOrDefault(c => c.DisplayName == "Do The Other Thing CHANGED");