I am getting an error whenever I try to call a custom api function in c# asp.net core. The Error code I am getting
Cannot implicitly convert type MnrtPortal.Helpers.CustomApiResponse to Microsoft.AspNetCore.Mvc.IActionResult an explicit conversion exists.
[Route("api/User")]
public IActionResult User()
{
var user = new
{
Name = "Joshua",
Age = 40
};
// return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
return CustomApiResponse.Create(200,user,"success");
}