29 references to ResourceSnapshotChangeType
Aspire.Hosting (12)
Dashboard\DashboardService.cs (2)
347if (update.ChangeType is ResourceSnapshotChangeType.Upsert) 351else if (update.ChangeType is ResourceSnapshotChangeType.Delete)
Dashboard\DashboardServiceData.cs (1)
108await _resourcePublisher.IntegrateAsync(@event.Resource, snapshot, ResourceSnapshotChangeType.Upsert)
Dashboard\ResourcePublisher.cs (4)
84internal async ValueTask IntegrateAsync(IResource source, ResourceSnapshot snapshot, ResourceSnapshotChangeType changeType) 92case ResourceSnapshotChangeType.Upsert: 96case ResourceSnapshotChangeType.Delete: 116ResourceSnapshotChangeType ChangeType,
Dcp\DcpResourceWatcher.cs (5)
321var changeType = watchEventType switch 323WatchEventType.Added or WatchEventType.Modified => ResourceSnapshotChangeType.Upsert, 324WatchEventType.Deleted => ResourceSnapshotChangeType.Delete, 325_ => throw new System.ComponentModel.InvalidEnumArgumentException($"Cannot convert {nameof(WatchEventType)} with value {watchEventType} into enum of type {nameof(ResourceSnapshotChangeType)}.") 334if (changeType == ResourceSnapshotChangeType.Delete)
Aspire.Hosting.Tests (16)
Dashboard\ResourcePublisherTests.cs (16)
66await publisher.IntegrateAsync(new TestResource("A"), a, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 67await publisher.IntegrateAsync(new TestResource("B"), b, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 89await publisher.IntegrateAsync(new TestResource("C"), c, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 92Assert.Equal(ResourceSnapshotChangeType.Upsert, change.ChangeType); 119await publisher.IntegrateAsync(new TestResource("A"), a, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 120await publisher.IntegrateAsync(new TestResource("B"), b, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 132await publisher.IntegrateAsync(new TestResource("C"), c, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 143Assert.Equal(ResourceSnapshotChangeType.Upsert, v1.ChangeType); 144Assert.Equal(ResourceSnapshotChangeType.Upsert, v2.ChangeType); 166await publisher.IntegrateAsync(new TestResource("A"), a1, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 167await publisher.IntegrateAsync(new TestResource("A"), a2, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 168await publisher.IntegrateAsync(new TestResource("A"), a3, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 186await publisher.IntegrateAsync(new TestResource("A"), a, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 187await publisher.IntegrateAsync(new TestResource("B"), b, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 188await publisher.IntegrateAsync(new TestResource("A"), a, ResourceSnapshotChangeType.Delete).DefaultTimeout(); 220await publisher.IntegrateAsync(new TestResource("A"), CreateResourceSnapshot("A"), ResourceSnapshotChangeType.Upsert).DefaultTimeout();
Aspire.Hosting.TestUtilities (1)
Helpers\DashboardServiceDataExtensions.cs (1)
21if (TryFindMatch(changes.Where(c => c.ChangeType != ResourceSnapshotChangeType.Delete).Select(c => c.Resource), resourceName, predicate, out match))