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