I am trying to use the Monitoring API, but when making a request from postman, I am getting internal server error.
My controller Code
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using ProjectName.JobScheduler.Base.Interface;
using Microsoft.AspNetCore.Hosting.Server;
using ProjectName.JobScheduler.Hangfire.Interface;
using Hangfire.Storage.Monitoring;
using Hangfire.Storage;
namespace ProjectName.WebAPI.Controllers.v1
{
[ApiController]
public class HangFiredashboardController : Controller
{
private readonly IMonitoringApi _moniteringAPI;
public HangFiredashboardController(IMonitoringApi monitoringApi)
{
_moniteringAPI = monitoringApi;
}
[HttpGet]
[Route("apidashboard")]
public ActionResult<IList<ServerDto>> APIDashboard()
{
IList<ServerDto> list = _moniteringAPI.Servers();
return list;
}
}
}