Base solution for your next web application
Open Closed

API Error #12265


User avatar
0
qquestel created

I have created one controller in my host project. It's a very simple controller and facing some issue. I tried most of the solutions but everything is ok in my project. could you please help me resolve this issue?


1 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi

    The class that the controller inherits from should be YourProjectNameControllerBase.

    [Route("api/[controller]/[action]")]
    
    public class EmployeeDashboardController : YourProjectNameControllerBase
    {
    
        [HttpGet("GetDashboardData")]
        public IActionResult GetDashboardData()
        {
            return Ok("Data");
        }
    }
    

    When the route is defined this way, the URL becomes: https://localhost:44301/api/EmployeeDashboard/GetDashboardData/GetDashboardData. You can update the route according to your scenario.