I have this controller method
//[HttpGet("{id}")]
public IActionResult Nav(string id)
{
return HtmlEncoder.Default.Encode($"Hello {id}");
//return Content("Here's the ContentResult message.");
}
that i want to pass a string parameter and display it when i visit the controller method https://localhost:7123/Home/Nav/Logan. I get this error.
Cannot implicitly convert type 'string' to 'Microsoft.AspNetCore.Mvc.IActionResult'
I am using asp net core 6.