locked
Attribute routing RRS feed

  • Question

  • User1396448631 posted

    Hi,

    I have this sample web api project

    namespace WebApplication1.Controllers
    {
        [RoutePrefix("api/v1/employee")]
        public class EmployeeController : ApiController
        {
            
            public IEnumerable<Employee> GetEmployees(int departmentId)
            {
                
            }
        }
    }

    What should I have in the url to hit GetEmployees method with departmentid = 123

    I tried the following but it says resource might have been moved

    http://localhost:54894/api/v1/employee/GetEmployees/123

    Thursday, November 30, 2017 7:57 PM

Answers