11 instantiations of CustomResourceSnapshot
Aspire.Hosting (3)
ApplicationModel\ResourceNotificationService.cs (1)
491previousState ??= new CustomResourceSnapshot()
Dashboard\DashboardLifecycleHook.cs (1)
143var snapshot = new CustomResourceSnapshot()
ParameterResourceBuilderExtensions.cs (1)
163var state = new CustomResourceSnapshot()
Aspire.Hosting.Dapr (2)
IDistributedApplicationBuilderExtensions.cs (1)
48.WithInitialState(new()
IDistributedApplicationComponentBuilderExtensions.cs (1)
58.WithInitialState(new()
Aspire.Hosting.Tests (2)
Dashboard\ResourcePublisherTests.cs (1)
185return new GenericResourceSnapshot(new()
ResourceCommandAnnotationTests.cs (1)
48ResourceSnapshot = new CustomResourceSnapshot
CustomResources.AppHost (1)
TestResource.cs (1)
15.WithInitialState(new()
HealthChecksSandbox.AppHost (1)
Program.cs (1)
51.WithInitialState(new()
Stress.AppHost (2)
TestResource.cs (2)
16.WithInitialState(new() 33.WithInitialState(new()
39 references to CustomResourceSnapshot
Aspire.Hosting (33)
ApplicationModel\ResourceNotificationService.cs (18)
164static bool IsContinuableState(CustomResourceSnapshot snapshot) => 226static bool IsKnownTerminalState(CustomResourceSnapshot snapshot) => 339/// Updates the snapshot of the <see cref="CustomResourceSnapshot"/> for a resource. 344public Task PublishUpdateAsync(IResource resource, string resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 350var previousState = GetCurrentSnapshot(resource, notificationState); 352var newState = stateFactory(previousState); 394private CustomResourceSnapshot UpdateCommands(IResource resource, CustomResourceSnapshot previousState) 457static ResourceCommandSnapshot CreateCommandFromAnnotation(ResourceCommandAnnotation annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider) 466/// Updates the snapshot of the <see cref="CustomResourceSnapshot"/> for a resource. 470public async Task PublishUpdateAsync(IResource resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 479private static CustomResourceSnapshot GetCurrentSnapshot(IResource resource, ResourceNotificationState notificationState) 481var previousState = notificationState.LastSnapshot; 510public CustomResourceSnapshot? LastSnapshot { get; set; } 520public class ResourceEvent(IResource resource, string resourceId, CustomResourceSnapshot snapshot) 535public CustomResourceSnapshot Snapshot { get; } = snapshot;
ApplicationModel\ResourceSnapshotAnnotation.cs (2)
9public class ResourceSnapshotAnnotation(CustomResourceSnapshot initialSnapshot) : IResourceAnnotation 14public CustomResourceSnapshot InitialSnapshot { get; } = initialSnapshot ?? throw new ArgumentNullException(nameof(initialSnapshot));
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)
143var snapshot = new CustomResourceSnapshot()
Dashboard\DashboardServiceData.cs (1)
35static 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)
47yield return (KnownProperties.Resource.HealthState, CustomResourceSnapshot.ComputeHealthStatus(HealthReports, State) is not { } healthStatus ? Value.ForNull() : Value.ForString(healthStatus.ToString()), IsSensitive: false);
Dcp\ApplicationExecutor.cs (6)
387private async Task ProcessResourceChange<T>(WatchEventType watchEventType, T resource, ConcurrentDictionary<string, T> resourceByName, string resourceKind, Func<T, CustomResourceSnapshot, CustomResourceSnapshot> snapshotFactory) where T : CustomResource 608private CustomResourceSnapshot ToSnapshot(Container container, CustomResourceSnapshot previous) 671private CustomResourceSnapshot ToSnapshot(Executable executable, CustomResourceSnapshot previous)
ParameterResourceBuilderExtensions.cs (1)
163var state = new CustomResourceSnapshot()
Aspire.Hosting.Azure (2)
Provisioning\Provisioners\AzureProvisioner.cs (2)
113async Task UpdateStateAsync((IResource Resource, IAzureResource AzureResource) resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
Aspire.Hosting.Tests (4)
AddParameterTests.cs (2)
33var state = annotation.InitialSnapshot; 70var state = annotation.InitialSnapshot;
Health\HealthStatusTests.cs (1)
27var actualStatus = CustomResourceSnapshot.ComputeHealthStatus(reports, state);
ResourceNotificationTests.cs (1)
33var state = annotation.InitialSnapshot;