I'm currently developing a Web API and I'm figuring out about how to add a new method inside my controller FilmsController which has to execute a LINQ query simply returning the related JSON to the user. Everything seems correct but when I try to call that API an error 404 appears. The API I'm trying to call is api/NewFilms, which should be correct.
Here is the method GetNewFilms inside FilmsController:
public IQueryable<Film> GetNewFilms()
{
var query = from f in db.Films
orderby f.ReleaseYear descending
select f;
return query;
}
// GET: api/Films
public IQueryable<Film> GetFilms()
{
return db.Films;
}