Hemapriya

Hemapriya

  • 1.5k
  • 233
  • 1.4k

HealthCheck

Jun 12 2024 11:21 AM

Hi All,

I want to call an API method  of same project via CheckHealthAsync.

any help!

 private readonly ISampleService _sampleService;

public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context,
    CancellationToken cancellationToken = new())
{
    try
    {
        var result = await _sampleService.GetName() // Need to implement the code for call.

    // If we get the result then it's healthy
    }
    catch (Exception ex)
    {
      
    }


Answers (1)