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