29 references to ResourceSnapshotChangeType
Aspire.Hosting (12)
Dashboard\DashboardService.cs (2)
248
if (update.ChangeType is
ResourceSnapshotChangeType
.Upsert)
252
else if (update.ChangeType is
ResourceSnapshotChangeType
.Delete)
Dashboard\DashboardServiceData.cs (1)
79
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\DcpExecutor.cs (5)
365
var
changeType = watchEventType switch
367
WatchEventType.Added or WatchEventType.Modified =>
ResourceSnapshotChangeType
.Upsert,
368
WatchEventType.Deleted =>
ResourceSnapshotChangeType
.Delete,
369
_ => throw new System.ComponentModel.InvalidEnumArgumentException($"Cannot convert {nameof(WatchEventType)} with value {watchEventType} into enum of type {nameof(
ResourceSnapshotChangeType
)}.")
378
if (changeType ==
ResourceSnapshotChangeType
.Delete)
Aspire.Hosting.Tests (17)
Dashboard\ResourcePublisherTests.cs (16)
22
await publisher.IntegrateAsync(new TestResource("A"), a,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
23
await publisher.IntegrateAsync(new TestResource("B"), b,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
45
await publisher.IntegrateAsync(new TestResource("C"), c,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
48
Assert.Equal(
ResourceSnapshotChangeType
.Upsert, change.ChangeType);
75
await publisher.IntegrateAsync(new TestResource("A"), a,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
76
await publisher.IntegrateAsync(new TestResource("B"), b,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
88
await publisher.IntegrateAsync(new TestResource("C"), c,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
99
Assert.Equal(
ResourceSnapshotChangeType
.Upsert, v1.ChangeType);
100
Assert.Equal(
ResourceSnapshotChangeType
.Upsert, v2.ChangeType);
122
await publisher.IntegrateAsync(new TestResource("A"), a1,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
123
await publisher.IntegrateAsync(new TestResource("A"), a2,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
124
await publisher.IntegrateAsync(new TestResource("A"), a3,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
142
await publisher.IntegrateAsync(new TestResource("A"), a,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
143
await publisher.IntegrateAsync(new TestResource("B"), b,
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
144
await publisher.IntegrateAsync(new TestResource("A"), a,
ResourceSnapshotChangeType
.Delete).DefaultTimeout();
176
await publisher.IntegrateAsync(new TestResource("A"), CreateResourceSnapshot("A"),
ResourceSnapshotChangeType
.Upsert).DefaultTimeout();
Helpers\DashboardServiceDataExtensions.cs (1)
21
if (TryFindMatch(changes.Where(c => c.ChangeType !=
ResourceSnapshotChangeType
.Delete).Select(c => c.Resource), resourceName, predicate, out match))