90 instantiations of CustomResourceSnapshot
Aspire.Hosting (9)
ApplicationModel\CertificateAuthorityCollectionResourceExtensions.cs (1)
32.WithInitialState(new CustomResourceSnapshot
ApplicationModel\ResourceNotificationService.cs (1)
1250previousState ??= new CustomResourceSnapshot()
ConnectionStringBuilderExtensions.cs (1)
82.WithInitialState(new CustomResourceSnapshot
Dashboard\DashboardEventHandlers.cs (1)
486var snapshot = new CustomResourceSnapshot
DotnetToolResourceExtensions.cs (1)
47.WithInitialState(new CustomResourceSnapshot
ExternalServiceBuilderExtensions.cs (1)
106.WithInitialState(new CustomResourceSnapshot
ParameterResourceBuilderExtensions.cs (1)
301var state = new CustomResourceSnapshot
ProjectResourceBuilderExtensions.cs (1)
1069.WithInitialState(new CustomResourceSnapshot
TerminalResourceBuilderExtensions.cs (1)
392host.Annotations.Add(new ResourceSnapshotAnnotation(new CustomResourceSnapshot
Aspire.Hosting.Azure (2)
AzureEnvironmentResourceExtensions.cs (2)
44.WithInitialState(new CustomResourceSnapshot 83.WithInitialState(new()
Aspire.Hosting.Blazor (3)
BlazorGatewayExtensions.cs (2)
138.WithInitialState(new CustomResourceSnapshot 162.WithInitialState(new CustomResourceSnapshot
BrowserDebuggerHelper.cs (1)
91.WithInitialState(new()
Aspire.Hosting.Blazor.Tests (3)
BlazorHostedExtensionsTests.cs (1)
548ResourceSnapshot = new CustomResourceSnapshot
WithBlazorAppTests.cs (2)
252ResourceSnapshot = new CustomResourceSnapshot 293ResourceSnapshot = new CustomResourceSnapshot
Aspire.Hosting.Browsers (1)
BrowserLogsBuilderExtensions.cs (1)
144.WithInitialState(new CustomResourceSnapshot
Aspire.Hosting.Browsers.Tests (35)
BrowserLogsBuilderExtensionsTests.cs (34)
35.WithInitialState(new CustomResourceSnapshot 89.WithInitialState(new CustomResourceSnapshot 144.WithInitialState(new CustomResourceSnapshot 180.WithInitialState(new CustomResourceSnapshot 213.WithInitialState(new CustomResourceSnapshot 290.WithInitialState(new CustomResourceSnapshot 317.WithInitialState(new CustomResourceSnapshot 341.WithInitialState(new CustomResourceSnapshot 367.WithInitialState(new CustomResourceSnapshot 389.WithInitialState(new CustomResourceSnapshot 410.WithInitialState(new CustomResourceSnapshot 434.WithInitialState(new CustomResourceSnapshot 470.WithInitialState(new CustomResourceSnapshot 513.WithInitialState(new CustomResourceSnapshot 553.WithInitialState(new CustomResourceSnapshot 592.WithInitialState(new CustomResourceSnapshot 637.WithInitialState(new CustomResourceSnapshot 677.WithInitialState(new CustomResourceSnapshot 687.WithInitialState(new CustomResourceSnapshot 727.WithInitialState(new CustomResourceSnapshot 781.WithInitialState(new CustomResourceSnapshot 825.WithInitialState(new CustomResourceSnapshot 865.WithInitialState(new CustomResourceSnapshot 938.WithInitialState(new CustomResourceSnapshot 994.WithInitialState(new CustomResourceSnapshot 1079.WithInitialState(new CustomResourceSnapshot 1152.WithInitialState(new CustomResourceSnapshot 1208.WithInitialState(new CustomResourceSnapshot 1268.WithInitialState(new CustomResourceSnapshot 1304.WithInitialState(new CustomResourceSnapshot 1332.WithInitialState(new CustomResourceSnapshot 1388.WithInitialState(new CustomResourceSnapshot 1523.WithInitialState(new CustomResourceSnapshot 1591.WithInitialState(new CustomResourceSnapshot
src\Aspire.Hosting.Browsers\BrowserLogsBuilderExtensions.cs (1)
144.WithInitialState(new CustomResourceSnapshot
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
107.WithInitialState(new() 671.WithInitialState(new()
Aspire.Hosting.DevTunnels.Tests (3)
DevTunnelResourceBuilderExtensionsTests.cs (3)
437ResourceSnapshot = new() 447ResourceSnapshot = new() 458ResourceSnapshot = new()
Aspire.Hosting.EntityFrameworkCore (2)
EFResourceBuilderExtensions.cs (2)
187.WithInitialState(new CustomResourceSnapshot 647.WithInitialState(new CustomResourceSnapshot
Aspire.Hosting.EntityFrameworkCore.Tests (4)
EFMigrationCommandsTests.cs (4)
198var snapshot = new CustomResourceSnapshot 228var snapshot = new CustomResourceSnapshot 258var snapshot = new CustomResourceSnapshot 278snapshot = new CustomResourceSnapshot
Aspire.Hosting.GitHub.Models (1)
GitHubModelsExtensions.cs (1)
55.WithInitialState(new()
Aspire.Hosting.Maui (1)
MauiOtlpExtensions.cs (1)
109stubBuilder.WithHidden().WithInitialState(new CustomResourceSnapshot
Aspire.Hosting.Maui.Tests (1)
MauiBuildQueueTests.cs (1)
762ResourceSnapshot = new CustomResourceSnapshot
Aspire.Hosting.OpenAI (2)
OpenAIExtensions.cs (2)
66.WithInitialState(new() 115.WithInitialState(new()
Aspire.Hosting.Tests (10)
Backchannel\AppHostBackchannelTests.cs (1)
60.WithInitialState(new () {
Dashboard\ResourcePublisherTests.cs (1)
204return new GenericResourceSnapshot(new()
Dcp\DcpExecutorTests.cs (1)
10170return new()
Dcp\ResourceSnapshotBuilderTests.cs (1)
295return new()
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
325var testSnapshot = new CustomResourceSnapshot
Orchestrator\ApplicationOrchestratorTests.cs (1)
1104.WithInitialState(new CustomResourceSnapshot
ResourceCommandAnnotationTests.cs (2)
61ResourceSnapshot = new CustomResourceSnapshot 141ResourceSnapshot = new CustomResourceSnapshot
ResourceNotificationTests.cs (1)
31.WithInitialState(new()
WithUrlsTests.cs (1)
544.WithInitialState(new()
CustomResources.AppHost (3)
TalkingClockResource.cs (2)
41.WithInitialState(new CustomResourceSnapshot // Aspire type for custom resource state. 130.WithInitialState(new()
TestResource.cs (1)
17.WithInitialState(new()
HealthChecksSandbox.AppHost (2)
AppHost.cs (2)
69.WithInitialState(new() 112.WithInitialState(new()
Stress.AppHost (6)
AppHost.cs (1)
58.WithInitialState(new CustomResourceSnapshot
TestResource.cs (5)
18.WithInitialState(new() 36.WithInitialState(new() 55.WithInitialState(new() 72.WithInitialState(new() 88.WithInitialState(new()
137 references to CustomResourceSnapshot
Aspire.Hosting (76)
ApplicationModel\CustomResourceSnapshot.cs (1)
174internal bool ContentEquals(CustomResourceSnapshot other)
ApplicationModel\CustomResourceSnapshotExtensions.cs (8)
9/// Provides extension methods for creating updated <see cref="CustomResourceSnapshot"/> values. 21/// This method is intended for use with <see cref="ResourceNotificationService.PublishUpdateAsync(IResource, Func{CustomResourceSnapshot, CustomResourceSnapshot})"/> 22/// and <see cref="ResourceNotificationService.PublishUpdateAsync(IResource, string, Func{CustomResourceSnapshot, CustomResourceSnapshot})"/>. 23/// Updating health reports also recomputes <see cref="CustomResourceSnapshot.HealthStatus"/> based on the snapshot state. 25public static CustomResourceSnapshot WithHealthReports(this CustomResourceSnapshot snapshot, ImmutableArray<HealthReportSnapshot> healthReports)
ApplicationModel\ResourceCommandAnnotation.cs (2)
369public required CustomResourceSnapshot ResourceSnapshot { get; init; } 425internal static UpdateCommandStateResourceSnapshot FromSnapshot(CustomResourceSnapshot snapshot)
ApplicationModel\ResourceNotificationService.cs (30)
286internal static bool ShouldYieldHealthyWait(WaitBehavior waitBehavior, CustomResourceSnapshot snapshot) => 333var snapshot = resourceEvent.Snapshot; 366static bool IsKnownTerminalState(CustomResourceSnapshot snapshot) => 397var snapshot = resourceEvent.Snapshot; 434static bool IsContinuableState(WaitBehavior waitBehavior, CustomResourceSnapshot snapshot) => 819/// Updates the snapshot of the <see cref="CustomResourceSnapshot"/> for a resource. 828public Task PublishUpdateAsync(IResource resource, string resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 838var previousState = GetCurrentSnapshot(resource, notificationState); 840var newState = stateFactory(previousState); 958CustomResourceSnapshot? previousSnapshot, 959CustomResourceSnapshot snapshot) 1045CustomResourceSnapshot readySnapshot, 1090private CustomResourceSnapshot UpdateCommands(IResource resource, CustomResourceSnapshot previousState) 1153static ResourceCommandSnapshot CreateCommandFromAnnotation(ResourceCommandAnnotation annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider) 1170private static CustomResourceSnapshot UpdateIcons(IResource resource, CustomResourceSnapshot previousState) 1198private static CustomResourceSnapshot UpdateDashboardVisibility(IResource resource, CustomResourceSnapshot previousState) 1221/// Updates the snapshot of the <see cref="CustomResourceSnapshot"/> for a resource. 1229public async Task PublishUpdateAsync(IResource resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 1238private static CustomResourceSnapshot GetCurrentSnapshot(IResource resource, ResourceNotificationState notificationState) 1240var previousState = notificationState.LastSnapshot; 1292var snapshot = evt.Snapshot; 1392public CustomResourceSnapshot? LastSnapshot { get; set; } 1406CustomResourceSnapshot Snapshot, 1442public class ResourceEvent(IResource resource, string resourceId, CustomResourceSnapshot snapshot) 1457public 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)
145var healthStatus = CustomResourceSnapshot.ComputeHealthStatus(resourceEvent.Snapshot.HealthReports, resourceEvent.Snapshot.State?.Text);
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
1045var snapshot = resourceEvent.Snapshot;
CustomResourceExtensions.cs (2)
18/// <param name="initialSnapshot">The factory to create the initial <see cref="CustomResourceSnapshot"/> for this resource.</param> 22public static IResourceBuilder<TResource> WithInitialState<TResource>(this IResourceBuilder<TResource> builder, CustomResourceSnapshot initialSnapshot)
Dashboard\DashboardEventHandlers.cs (1)
486var snapshot = new CustomResourceSnapshot
Dashboard\DashboardServiceData.cs (1)
43static 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)
51yield return (KnownProperties.Resource.HealthState, CustomResourceSnapshot.ComputeHealthStatus(HealthReports, State) is not { } healthStatus ? Value.ForNull() : Value.ForString(healthStatus.ToString()), IsSensitive: false, DisplayName: null, IsHighlighted: false, SortOrder: null);
Dcp\DcpExecutor.cs (2)
1024Func<CustomResourceSnapshot, CustomResourceSnapshot> BuildSnapshotFunc(CustomResource dcpResource)
Dcp\DcpExecutorEvents.cs (2)
14internal record OnResourceChangedContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string DcpResourceName, ResourceStatus Status, Func<CustomResourceSnapshot, CustomResourceSnapshot> UpdateSnapshot);
Dcp\DcpResourceWatcher.cs (2)
271private async Task ProcessResourceChange<T>(WatchEventType watchEventType, T resource, ConcurrentDictionary<string, T> resourceByName, string resourceKind, Func<T, CustomResourceSnapshot, CustomResourceSnapshot> snapshotFactory) where T : CustomResource, IKubernetesStaticMetadata
Dcp\ResourceSnapshotBuilder.cs (6)
23public CustomResourceSnapshot ToSnapshot(Container container, CustomResourceSnapshot previous) 98public CustomResourceSnapshot ToSnapshot(ContainerExec executable, CustomResourceSnapshot previous) 133public CustomResourceSnapshot ToSnapshot(Executable executable, CustomResourceSnapshot previous)
Diagnostics\ProfilingTelemetry.cs (8)
421CustomResourceSnapshot snapshot, 1033public void SetResourceLifecycle(IResource resource, string resourceId, CustomResourceSnapshot snapshot) 1050public void AddResourceStartupObserved(CustomResourceSnapshot snapshot, DateTimeOffset timestamp) => 1053public void AddResourceStartupStateChanged(CustomResourceSnapshot snapshot, DateTimeOffset timestamp, string? previousState) => 1056public void AddResourceStartupHealthChanged(CustomResourceSnapshot snapshot, DateTimeOffset timestamp, string? previousHealthStatus) => 1059public void AddResourceStartupReady(CustomResourceSnapshot snapshot, DateTimeOffset timestamp) => 1098var snapshot = resourceEvent.Snapshot; 1129CustomResourceSnapshot snapshot,
DistributedApplication.cs (1)
833public required CustomResourceSnapshot? Snapshot { get; init; }
Lifecycle\TerminalHostFailureDiagnosticService.cs (1)
99private async Task SurfaceFailureAsync(TerminalHostResource host, CustomResourceSnapshot snapshot, CancellationToken cancellationToken)
Orchestrator\ApplicationOrchestrator.cs (2)
283static Task PublishUpdateAsync(ResourceNotificationService notificationService, IResource resource, string? resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
ParameterResourceBuilderExtensions.cs (1)
301var state = new CustomResourceSnapshot
Aspire.Hosting.Azure (6)
AzureProvisioningController.cs (6)
988private static bool IsCancelableDeploymentState(CustomResourceSnapshot snapshot) 994private static bool IsActiveOperationCancelableResourceState(CustomResourceSnapshot snapshot) 3605private CustomResourceSnapshot ApplyActiveOperationProperties(IResource resource, CustomResourceSnapshot state) 3676Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
Aspire.Hosting.Azure.Tests (4)
AzureEnvironmentResourceExtensionsTests.cs (4)
2730var storageSnapshot = storageEvent.Snapshot; 5032private static void AssertAffectedResourceCommandsDuringOperation(CustomResourceSnapshot snapshot) 5042private static void AssertUnaffectedResourceCommandsDuringOperation(CustomResourceSnapshot snapshot) 5052private static void AssertCommandState(CustomResourceSnapshot snapshot, string commandName, ResourceCommandState expectedState)
Aspire.Hosting.Blazor.Tests (1)
AddBlazorWasmAppTests.cs (1)
33var state = snapshot.InitialSnapshot;
Aspire.Hosting.Browsers.Tests (6)
BrowserLogsBuilderExtensionsTests.cs (6)
68var snapshot = browserLogsResource.Annotations.OfType<ResourceSnapshotAnnotation>().Single().InitialSnapshot; 228var snapshot = browserLogsResource.Annotations.OfType<ResourceSnapshotAnnotation>().Single().InitialSnapshot; 354var snapshot = browserLogsResource.Annotations.OfType<ResourceSnapshotAnnotation>().Single().InitialSnapshot; 1745private static bool HasProperty(CustomResourceSnapshot snapshot, string name, object expectedValue) => 1748private static bool DoesNotHaveProperty(CustomResourceSnapshot snapshot, string name) => 1751private static IReadOnlyList<BrowserSessionPropertyValue> GetBrowserSessions(CustomResourceSnapshot snapshot)
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
786CustomResourceSnapshot? stoppedSnapshot = default;
Aspire.Hosting.EntityFrameworkCore (1)
EFCoreOperationExecutor.cs (1)
351var snapshot = resourceEvent.Snapshot;
Aspire.Hosting.EntityFrameworkCore.Tests (3)
EFMigrationCommandsTests.cs (3)
198var snapshot = new CustomResourceSnapshot 228var snapshot = new CustomResourceSnapshot 258var snapshot = new CustomResourceSnapshot
Aspire.Hosting.Tests (39)
AddConnectionStringTests.cs (1)
63var state = annotation.InitialSnapshot;
AddParameterTests.cs (1)
34var state = annotation.InitialSnapshot;
Dcp\DcpExecutorTests.cs (5)
397var snapshot = CreateSnapshotBuilder(distributedAppModel).ToSnapshot(exe, CreatePreviousSnapshot()); 443var snapshot = CreateSnapshotBuilder(distributedAppModel).ToSnapshot(container, CreatePreviousSnapshot()); 10168private static CustomResourceSnapshot CreatePreviousSnapshot() 10177private static ResourcePropertySnapshot GetProperty(CustomResourceSnapshot snapshot, string name) 10182private static IEnumerable<T> GetEnumerablePropertyValue<T>(CustomResourceSnapshot snapshot, string name)
Dcp\ResourceSnapshotBuilderTests.cs (15)
32var snapshot = CreateSnapshotBuilder().ToSnapshot(container, CreatePreviousSnapshot()); 52var snapshot = CreateSnapshotBuilder().ToSnapshot(executable, CreatePreviousSnapshot()); 76var snapshot = CreateSnapshotBuilder(new Dictionary<string, IResource> 106var snapshot = snapshotBuilder.ToSnapshot(executable, CreatePreviousSnapshot()); 173var projectSnapshot = snapshotBuilder.ToSnapshot(executable, CreatePreviousSnapshot(KnownResourceTypes.Project)); 178var customSnapshot = snapshotBuilder.ToSnapshot(executable, CreatePreviousSnapshot("custom-type")); 192var snapshot = CreateSnapshotBuilder().ToSnapshot(executable, CreatePreviousSnapshot()); 210var snapshot = CreateSnapshotBuilder().ToSnapshot(executable, CreatePreviousSnapshot()); 225var snapshot = CreateSnapshotBuilder().ToSnapshot(executable, CreatePreviousSnapshot()); 255var snapshot = CreateSnapshotBuilder().ToSnapshot(executable, CreatePreviousSnapshot()); 293private static CustomResourceSnapshot CreatePreviousSnapshot(string resourceType = "resource") 302private static ResourcePropertySnapshot GetProperty(CustomResourceSnapshot snapshot, string name) 307private static void AssertHighlightedProperty(CustomResourceSnapshot snapshot, string name, string displayName, bool isSensitive, int sortOrder) 316private static void AssertDefaultProperty(CustomResourceSnapshot snapshot, string name, bool isSensitive) 325private static IEnumerable<T> GetEnumerablePropertyValue<T>(CustomResourceSnapshot snapshot, string name)
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
325var testSnapshot = new CustomResourceSnapshot
Health\HealthStatusTests.cs (1)
27var actualStatus = CustomResourceSnapshot.ComputeHealthStatus(reports, state);
Lifecycle\TerminalHostFailureDiagnosticServiceTests.cs (2)
114var current = await ReadCurrentSnapshotAsync(notifications, host).DefaultTimeout(); 259private static async Task<CustomResourceSnapshot> ReadCurrentSnapshotAsync(ResourceNotificationService notifications, IResource host)
Orchestrator\ParameterProcessorTests.cs (2)
86var updates = new List<(IResource Resource, CustomResourceSnapshot Snapshot)>(); 1331private static void AssertParameterValueProperty(CustomResourceSnapshot snapshot, string expectedValue, bool isSensitive)
ResourceNotificationTests.cs (11)
41var state = annotation.InitialSnapshot; 1488CustomResourceSnapshot BuildSnapshot(CustomResourceSnapshot snapshot) => snapshot with 1570typeof(CustomResourceSnapshot), 1584$"Changing {nameof(CustomResourceSnapshot)}.{propertyName} should publish a new snapshot."); 1626CreatePropertyTheoryData(typeof(CustomResourceSnapshot), s_snapshotContentPropertyExclusions); 1633nameof(CustomResourceSnapshot.Version), 1634nameof(CustomResourceSnapshot.HealthStatus) 1679private static CustomResourceSnapshot MutateProperty(CustomResourceSnapshot snapshot, PropertyInfo property) 1683var mutated = snapshot with { };