I am using Web Api with ASP.NET MVC, and I am very new to it. I have gone through some demo on asp.net website and I am trying to do the following.
I have 4 get meth
Also you will specify route on action for set route
[HttpGet]
[Route("api/customers/")]
public List Get()
{
//gets all customer logic
}
[HttpGet]
[Route("api/customers/currentMonth")]
public List GetCustomerByCurrentMonth()
{
//gets some customer
}
[HttpGet]
[Route("api/customers/{id}")]
public Customer GetCustomerById(string id)
{
//gets a single customer by specified id
}
[HttpGet]
[Route("api/customers/customerByUsername/{username}")]
public Customer GetCustomerByUsername(string username)
{
//gets customer by its username
}