I want to use to asp.net web api different method in same api controller. I searched but I couldn't find.
For example:
public class HomeController : ApiController
{
AdFindDBEntities db = new AdFindDBEntities();
public HomeController()
{
db.Configuration.ProxyCreationEnabled = false;
}
[HttpGet]
public List<Ad> AllAds()
{
return db.Ad.ToList();
}
[HttpGet]
public IEnumerable<Ad> GetLastAds()
{
return db.Ad.OrderByDescending(x => x.CreatedDate).Take(20).ToList();
}
}
When I run the project AllAds method running. I don't know how use to GetLastAds method. Please help me!