10 instantiations of CustomResourceSnapshot
Aspire.Hosting (4)
ApplicationModel\ResourceNotificationService.cs (1)
703
previousState ??= new
CustomResourceSnapshot
()
ConnectionStringBuilderExtensions.cs (1)
45
.WithInitialState(new
CustomResourceSnapshot
Dashboard\DashboardLifecycleHook.cs (1)
158
var snapshot = new
CustomResourceSnapshot
()
ParameterResourceBuilderExtensions.cs (1)
161
var state = new
CustomResourceSnapshot
()
Aspire.Hosting.Tests (2)
Dashboard\ResourcePublisherTests.cs (1)
185
return new GenericResourceSnapshot(
new
()
ResourceCommandAnnotationTests.cs (1)
52
ResourceSnapshot = 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
()
43 references to CustomResourceSnapshot
Aspire.Hosting (38)
ApplicationModel\ResourceNotificationService.cs (19)
208
static bool IsContinuableState(WaitBehavior waitBehavior,
CustomResourceSnapshot
snapshot) =>
290
static bool ShouldYield(WaitBehavior waitBehavior,
CustomResourceSnapshot
snapshot) =>
352
static bool IsKnownTerminalState(
CustomResourceSnapshot
snapshot) =>
497
/// Updates the snapshot of the <see cref="
CustomResourceSnapshot
"/> for a resource.
502
public Task PublishUpdateAsync(IResource resource, string resourceId, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> stateFactory)
508
var
previousState = GetCurrentSnapshot(resource, notificationState);
510
var
newState = stateFactory(previousState);
606
private
CustomResourceSnapshot
UpdateCommands(IResource resource,
CustomResourceSnapshot
previousState)
669
static ResourceCommandSnapshot CreateCommandFromAnnotation(ResourceCommandAnnotation annotation,
CustomResourceSnapshot
previousState, IServiceProvider serviceProvider)
678
/// Updates the snapshot of the <see cref="
CustomResourceSnapshot
"/> for a resource.
682
public async Task PublishUpdateAsync(IResource resource, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> stateFactory)
691
private static
CustomResourceSnapshot
GetCurrentSnapshot(IResource resource, ResourceNotificationState notificationState)
693
var
previousState = notificationState.LastSnapshot;
730
public
CustomResourceSnapshot
? LastSnapshot { get; set; }
740
public class ResourceEvent(IResource resource, string resourceId,
CustomResourceSnapshot
snapshot)
755
public
CustomResourceSnapshot
Snapshot { get; } = snapshot;
ApplicationModel\ResourceSnapshotAnnotation.cs (2)
9
public class ResourceSnapshotAnnotation(
CustomResourceSnapshot
initialSnapshot) : IResourceAnnotation
14
public
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>
20
public static IResourceBuilder<TResource> WithInitialState<TResource>(this IResourceBuilder<TResource> builder,
CustomResourceSnapshot
initialSnapshot)
Dashboard\DashboardLifecycleHook.cs (1)
158
var
snapshot = new CustomResourceSnapshot()
Dashboard\DashboardServiceData.cs (1)
35
static GenericResourceSnapshot CreateResourceSnapshot(IResource resource, string resourceId, DateTime creationTimestamp,
CustomResourceSnapshot
snapshot)
Dashboard\GenericResourceSnapshot.cs (1)
9
internal sealed class GenericResourceSnapshot(
CustomResourceSnapshot
state) : ResourceSnapshot
Dashboard\ResourceSnapshot.cs (1)
47
yield return (KnownProperties.Resource.HealthState,
CustomResourceSnapshot
.ComputeHealthStatus(HealthReports, State) is not { } healthStatus ? Value.ForNull() : Value.ForString(healthStatus.ToString()), IsSensitive: false);
Dcp\DcpExecutor.cs (2)
322
private 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)
13
internal record OnResourceChangedContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string DcpResourceName, ResourceStatus Status, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> UpdateSnapshot);
Dcp\ResourceSnapshotBuilder.cs (4)
20
public
CustomResourceSnapshot
ToSnapshot(Container container,
CustomResourceSnapshot
previous)
89
public
CustomResourceSnapshot
ToSnapshot(Executable executable,
CustomResourceSnapshot
previous)
Orchestrator\ApplicationOrchestrator.cs (2)
140
static Task PublishUpdateAsync(ResourceNotificationService notificationService, IResource resource, string? resourceId, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> stateFactory)
ParameterResourceBuilderExtensions.cs (1)
161
var
state = new CustomResourceSnapshot()
Aspire.Hosting.Azure (2)
Provisioning\Provisioners\AzureProvisioner.cs (2)
106
async Task UpdateStateAsync((IResource Resource, IAzureResource AzureResource) resource, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> stateFactory)
Aspire.Hosting.Tests (3)
AddParameterTests.cs (1)
32
var
state = annotation.InitialSnapshot;
Health\HealthStatusTests.cs (1)
27
var actualStatus =
CustomResourceSnapshot
.ComputeHealthStatus(reports, state);
ResourceNotificationTests.cs (1)
33
var
state = annotation.InitialSnapshot;