29 references to ResourceSnapshotChangeType
Aspire.Hosting (12)
Dashboard\DashboardService.cs (2)
319if (update.ChangeType is ResourceSnapshotChangeType.Upsert) 323else if (update.ChangeType is ResourceSnapshotChangeType.Delete)
Dashboard\DashboardServiceData.cs (1)
107await _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)
283var changeType = watchEventType switch 285WatchEventType.Added or WatchEventType.Modified => ResourceSnapshotChangeType.Upsert, 286WatchEventType.Deleted => ResourceSnapshotChangeType.Delete, 287_ => throw new System.ComponentModel.InvalidEnumArgumentException($"Cannot convert {nameof(WatchEventType)} with value {watchEventType} into enum of type {nameof(ResourceSnapshotChangeType)}.") 296if (changeType == ResourceSnapshotChangeType.Delete)
Aspire.Hosting.Tests (16)
Dashboard\ResourcePublisherTests.cs (16)
42await publisher.IntegrateAsync(new TestResource("A"), a, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 43await publisher.IntegrateAsync(new TestResource("B"), b, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 65await publisher.IntegrateAsync(new TestResource("C"), c, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 68Assert.Equal(ResourceSnapshotChangeType.Upsert, change.ChangeType); 95await publisher.IntegrateAsync(new TestResource("A"), a, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 96await publisher.IntegrateAsync(new TestResource("B"), b, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 108await publisher.IntegrateAsync(new TestResource("C"), c, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 119Assert.Equal(ResourceSnapshotChangeType.Upsert, v1.ChangeType); 120Assert.Equal(ResourceSnapshotChangeType.Upsert, v2.ChangeType); 142await publisher.IntegrateAsync(new TestResource("A"), a1, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 143await publisher.IntegrateAsync(new TestResource("A"), a2, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 144await publisher.IntegrateAsync(new TestResource("A"), a3, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 162await publisher.IntegrateAsync(new TestResource("A"), a, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 163await publisher.IntegrateAsync(new TestResource("B"), b, ResourceSnapshotChangeType.Upsert).DefaultTimeout(); 164await publisher.IntegrateAsync(new TestResource("A"), a, ResourceSnapshotChangeType.Delete).DefaultTimeout(); 196await 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))