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