16 instantiations of CustomResourceSnapshot
Aspire.Hosting (4)
ApplicationModel\ResourceNotificationService.cs (1)
708previousState ??= new CustomResourceSnapshot()
ConnectionStringBuilderExtensions.cs (1)
43.WithInitialState(new CustomResourceSnapshot
Dashboard\DashboardLifecycleHook.cs (1)
166var snapshot = new CustomResourceSnapshot
ParameterResourceBuilderExtensions.cs (1)
161var state = new CustomResourceSnapshot
Aspire.Hosting.Tests (5)
Backchannel\AppHostBackchannelTests.cs (1)
96.WithInitialState(new () {
Dashboard\ResourcePublisherTests.cs (1)
185return new GenericResourceSnapshot(new()
ResourceCommandAnnotationTests.cs (1)
58ResourceSnapshot = new CustomResourceSnapshot
ResourceNotificationTests.cs (1)
23.WithInitialState(new()
WithUrlsTests.cs (1)
410.WithInitialState(new()
CustomResources.AppHost (3)
TalkingClockResource.cs (2)
108.WithInitialState(new CustomResourceSnapshot // Aspire type for custom resource state. 130.WithInitialState(new()
TestResource.cs (1)
15.WithInitialState(new()
HealthChecksSandbox.AppHost (1)
Program.cs (1)
51.WithInitialState(new()
Stress.AppHost (3)
Program.cs (1)
31.WithInitialState(new CustomResourceSnapshot
TestResource.cs (2)
16.WithInitialState(new() 33.WithInitialState(new()
47 references to CustomResourceSnapshot
Aspire.Hosting (42)
ApplicationModel\ResourceCommandAnnotation.cs (1)
164public required CustomResourceSnapshot ResourceSnapshot { get; init; }
ApplicationModel\ResourceNotificationService.cs (21)
163var snapshot = resourceEvent.Snapshot; 209static bool IsContinuableState(WaitBehavior waitBehavior, CustomResourceSnapshot snapshot) => 291static bool ShouldYield(WaitBehavior waitBehavior, CustomResourceSnapshot snapshot) => 325var snapshot = resourceEvent.Snapshot; 353static bool IsKnownTerminalState(CustomResourceSnapshot snapshot) => 516/// Updates the snapshot of the <see cref="CustomResourceSnapshot"/> for a resource. 521public Task PublishUpdateAsync(IResource resource, string resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 531var previousState = GetCurrentSnapshot(resource, notificationState); 533var newState = stateFactory(previousState); 611private CustomResourceSnapshot UpdateCommands(IResource resource, CustomResourceSnapshot previousState) 674static ResourceCommandSnapshot CreateCommandFromAnnotation(ResourceCommandAnnotation annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider) 683/// Updates the snapshot of the <see cref="CustomResourceSnapshot"/> for a resource. 687public async Task PublishUpdateAsync(IResource resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 696private static CustomResourceSnapshot GetCurrentSnapshot(IResource resource, ResourceNotificationState notificationState) 698var previousState = notificationState.LastSnapshot; 740public CustomResourceSnapshot? LastSnapshot { get; set; } 768public class ResourceEvent(IResource resource, string resourceId, CustomResourceSnapshot snapshot) 783public CustomResourceSnapshot Snapshot { get; } = snapshot;
ApplicationModel\ResourceSnapshotAnnotation.cs (2)
9public class ResourceSnapshotAnnotation(CustomResourceSnapshot initialSnapshot) : IResourceAnnotation 14public CustomResourceSnapshot InitialSnapshot { get; } = initialSnapshot ?? throw new ArgumentNullException(nameof(initialSnapshot));
Backchannel\AppHostRpcTarget.cs (1)
93var healthStatus = CustomResourceSnapshot.ComputeHealthStatus(resourceEvent.Snapshot.HealthReports, resourceEvent.Snapshot.State?.Text);
CustomResourceExtensions.cs (2)
18/// <param name="initialSnapshot">The factory to create the initial <see cref="CustomResourceSnapshot"/> for this resource.</param> 20public static IResourceBuilder<TResource> WithInitialState<TResource>(this IResourceBuilder<TResource> builder, CustomResourceSnapshot initialSnapshot)
Dashboard\DashboardLifecycleHook.cs (1)
166var snapshot = new CustomResourceSnapshot
Dashboard\DashboardServiceData.cs (1)
40static GenericResourceSnapshot CreateResourceSnapshot(IResource resource, string resourceId, DateTime creationTimestamp, CustomResourceSnapshot snapshot)
Dashboard\GenericResourceSnapshot.cs (1)
9internal sealed class GenericResourceSnapshot(CustomResourceSnapshot state) : ResourceSnapshot
Dashboard\ResourceSnapshot.cs (1)
49yield return (KnownProperties.Resource.HealthState, CustomResourceSnapshot.ComputeHealthStatus(HealthReports, State) is not { } healthStatus ? Value.ForNull() : Value.ForString(healthStatus.ToString()), IsSensitive: false);
Dcp\DcpExecutor.cs (2)
334private async Task ProcessResourceChange<T>(WatchEventType watchEventType, T resource, ConcurrentDictionary<string, T> resourceByName, string resourceKind, Func<T, CustomResourceSnapshot, CustomResourceSnapshot> snapshotFactory) where T : CustomResource
Dcp\DcpExecutorEvents.cs (2)
13internal record OnResourceChangedContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string DcpResourceName, ResourceStatus Status, Func<CustomResourceSnapshot, CustomResourceSnapshot> UpdateSnapshot);
Dcp\ResourceSnapshotBuilder.cs (4)
20public CustomResourceSnapshot ToSnapshot(Container container, CustomResourceSnapshot previous) 94public CustomResourceSnapshot ToSnapshot(Executable executable, CustomResourceSnapshot previous)
Orchestrator\ApplicationOrchestrator.cs (2)
185static Task PublishUpdateAsync(ResourceNotificationService notificationService, IResource resource, string? resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
ParameterResourceBuilderExtensions.cs (1)
161var state = new CustomResourceSnapshot
Aspire.Hosting.Azure (2)
Provisioning\Provisioners\AzureProvisioner.cs (2)
49async Task UpdateStateAsync((IResource Resource, IAzureResource AzureResource) resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
Aspire.Hosting.Tests (3)
AddParameterTests.cs (1)
32var state = annotation.InitialSnapshot;
Health\HealthStatusTests.cs (1)
27var actualStatus = CustomResourceSnapshot.ComputeHealthStatus(reports, state);
ResourceNotificationTests.cs (1)
33var state = annotation.InitialSnapshot;