PROPERTY
HealthCheckOptions.ResultStatusCodes
Maps aggregate health status to HTTP status for this middleware configuration. Default Degraded is 200; stricter readiness may choose 503. Mapping does not itself run a check or test actual probe behavior.
Formal Syntax & Structure
csharp syntaxcsharp
options.ResultStatusCodes[HealthStatus.Degraded] = 503;Working Example
Example Snippetcsharp
using System;using System.Collections.Generic;using System.Runtime.InteropServices;using Microsoft.Extensions.Diagnostics.HealthChecks;using Microsoft.AspNetCore.Diagnostics.HealthChecks;var options = new HealthCheckOptions(); options.ResultStatusCodes[HealthStatus.Degraded]=503; Console.WriteLine(options.ResultStatusCodes[HealthStatus.Degraded]); // 503