54 writes to State
Aspire.Hosting (8)
ApplicationModel\ResourceNotificationService.cs (2)
128
await PublishUpdateAsync(resource, s => s with {
State
= KnownResourceStates.Waiting }).ConfigureAwait(false);
196
await PublishUpdateAsync(resource, s => s with {
State
= KnownResourceStates.Waiting }).ConfigureAwait(false);
Dashboard\DashboardLifecycleHook.cs (1)
148
State
= configuration.GetBool("DOTNET_ASPIRE_SHOW_DASHBOARD_RESOURCES") is true ? null : KnownResourceStates.Hidden
Dcp\ApplicationExecutor.cs (3)
620
State
= state,
684
State
= state,
704
State
= state,
ParameterResourceBuilderExtensions.cs (2)
167
State
= KnownResourceStates.Hidden,
182
State
= new ResourceStateSnapshot("Configuration missing", KnownResourceStateStyles.Error),
Aspire.Hosting.Azure (4)
Provisioning\Provisioners\AzureProvisioner.cs (4)
147
State
= new("Running", KnownResourceStateStyles.Success)
155
State
= new("Missing subscription configuration", KnownResourceStateStyles.Error)
163
State
= new("Failed to Provision", KnownResourceStateStyles.Error)
176
State
= new("Starting", KnownResourceStateStyles.Info)
Aspire.Hosting.Dapr (2)
IDistributedApplicationBuilderExtensions.cs (1)
52
State
= KnownResourceStates.Hidden
IDistributedApplicationComponentBuilderExtensions.cs (1)
62
State
= KnownResourceStates.Hidden
Aspire.Hosting.Tests (34)
Codespaces\CodespacesUrlRewriterTests.cs (1)
78
State
= KnownResourceStates.Running,
Dashboard\DashboardResourceTests.cs (1)
468
await resourceNotificationService.PublishUpdateAsync(dashboard, "aspire-dashboard-0", s => s with {
State
= "Running" }).DefaultTimeout();
Dashboard\DashboardServiceTests.cs (1)
106
return s with {
State
= new ResourceStateSnapshot("Starting", null) };
Health\ResourceHealthCheckServiceTests.cs (12)
31
State
= new ResourceStateSnapshot(KnownResourceStates.Starting, null)
39
State
= new ResourceStateSnapshot(KnownResourceStates.Running, null)
65
State
= new ResourceStateSnapshot(KnownResourceStates.Starting, null)
73
State
= new ResourceStateSnapshot(KnownResourceStates.Running, null)
110
State
= KnownResourceStates.Running
157
State
= KnownResourceStates.Running
194
State
= new ResourceStateSnapshot(KnownResourceStates.Running, null)
226
State
= new ResourceStateSnapshot(KnownResourceStates.Running, null)
290
State
= new ResourceStateSnapshot(KnownResourceStates.Running, null)
335
State
= new ResourceStateSnapshot(KnownResourceStates.Running, null)
388
State
= new ResourceStateSnapshot(KnownResourceStates.Running, null)
396
State
= new ResourceStateSnapshot(KnownResourceStates.Running, null)
ResourceCommandAnnotationTests.cs (1)
52
State
= resourceState
ResourceNotificationTests.cs (13)
165
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "SomeState" }).DefaultTimeout();
181
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "SomeState" }).DefaultTimeout();
195
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "SomeState" }).DefaultTimeout();
211
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= KnownResourceStates.Running }).DefaultTimeout();
226
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "SomeOtherState" }).DefaultTimeout();
241
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "SomeOtherState" }).DefaultTimeout();
302
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "SomeState" }).DefaultTimeout();
313
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "SomeState" }).DefaultTimeout();
323
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "NewState" }).DefaultTimeout();
333
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= null }).DefaultTimeout();
343
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "" }).DefaultTimeout();
353
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= " " }).DefaultTimeout();
372
await notificationService.PublishUpdateAsync(resource1, snapshot => snapshot with {
State
= "SomeState" }).DefaultTimeout();
WaitForTests.cs (5)
115
State
= KnownResourceStates.Running
156
State
= KnownResourceStates.Finished,
204
State
= KnownResourceStates.Finished,
252
State
= KnownResourceStates.Finished,
333
State
= KnownResourceStates.Finished
CustomResources.AppHost (2)
TestResource.cs (2)
18
State
= "Starting",
62
State
= new(randomState, randomStyle)
HealthChecksSandbox.AppHost (1)
Program.cs (1)
54
State
= "Starting",
Stress.AppHost (3)
TestResource.cs (3)
19
State
= "Starting",
36
State
= "Starting",
80
State
= randomState
20 references to State
Aspire.Hosting (12)
ApplicationModel\CustomResourceSnapshot.cs (1)
84
HealthStatus = ComputeHealthStatus(value,
State
?.Text);
ApplicationModel\ResourceNotificationService.cs (9)
165
snapshot.
State
?.Text == KnownResourceStates.Running ||
166
snapshot.
State
?.Text == KnownResourceStates.Finished ||
167
snapshot.
State
?.Text == KnownResourceStates.Exited ||
168
snapshot.
State
?.Text == KnownResourceStates.FailedToStart;
227
KnownResourceStates.TerminalStates.Contains(snapshot.
State
?.Text) ||
360
if (_logger.IsEnabled(LogLevel.Debug) && newState.
State
?.Text is { Length: > 0 } newStateText && !string.IsNullOrWhiteSpace(newStateText))
362
var previousStateText = previousState?.
State
?.Text;
382
newState.ResourceType, newState.CreationTimeStamp, newState.
State
?.Text, newState.
State
?.Style,
Dashboard\DashboardServiceData.cs (2)
49
State = snapshot.
State
?.Text,
50
StateStyle = snapshot.
State
?.Style,
Aspire.Hosting.Tests (8)
AddParameterTests.cs (4)
35
Assert.Equal("Hidden", state.
State
);
72
Assert.NotNull(state.
State
);
73
Assert.Equal("Configuration missing", state.
State
.Text);
74
Assert.Equal(KnownResourceStateStyles.Error, state.
State
.Style);
Dashboard\DashboardResourceTests.cs (1)
54
Assert.Equal("Hidden", initialSnapshot.InitialSnapshot.
State
);
Health\ResourceHealthCheckServiceTests.cs (3)
34
var startingEvent = await rns.WaitForResourceAsync("resource", e => e.Snapshot.
State
?.Text == KnownResourceStates.Starting).DefaultTimeout();
68
var startingEvent = await rns.WaitForResourceAsync("resource", e => e.Snapshot.
State
?.Text == KnownResourceStates.Starting).DefaultTimeout();
76
var runningEvent = await rns.WaitForResourceAsync("resource", e => e.Snapshot.
State
?.Text == KnownResourceStates.Running).DefaultTimeout();