Skip to content
DocsTry Aspire
DocsTry

CustomResourceSnapshotExtensions Methods

ClassMethods1 member
Provides extension methods for creating updated CustomResourceSnapshot values.
WithHealthReports(CustomResourceSnapshot, ImmutableArray<HealthReportSnapshot>)Section titled WithHealthReports(CustomResourceSnapshot, ImmutableArray<HealthReportSnapshot>)extensionCustomResourceSnapshot
Creates a copy of the resource snapshot with the specified health reports.
public static class CustomResourceSnapshotExtensions
{
public static CustomResourceSnapshot WithHealthReports(
this CustomResourceSnapshot snapshot,
ImmutableArray<HealthReportSnapshot> healthReports)
{
// ...
}
}
snapshotCustomResourceSnapshotThe resource snapshot to update.
healthReportsImmutableArray<HealthReportSnapshot>The health reports to publish for the resource snapshot.
CustomResourceSnapshotA copy of snapshot with updated health reports.
ArgumentNullExceptionThrown when snapshot is null.
This method is intended for use with ResourceNotificationService.PublishUpdateAsync and ResourceNotificationService.PublishUpdateAsync. Updating health reports also recomputes CustomResourceSnapshot.HealthStatus based on the snapshot state.