/// <summary>
/// Get collection of movies as json.
/// </summary>
/// <returns></returns>
public ActionResult GetAllMovies1s()
{
// db-> DBContext
// Get the collection of movies.
var movies = db.Movies.ToList();
return Json(movies);
}
/// <summary>
/// Get collection of movies as json.
/// </summary>
/// <returns></returns>
public JsonResult GetAllMovies2()
{
// db-> DBContext
// Get the collection of movies.
var movies = db.Movies.ToList();
return Json(movies);
}
I am little bit novice to this,above two methods return json array to view to get movie JSON result to Ajax call.I know above two methods are fine to do the job done.But I want to know witch method is the better among them ?I think the ActionResult is better than JsonResult,since I heard about that when we write a function it is always good to return more generic return type (JsonResult is is concreate version of ActionResult).So Experts Please Help me to clarify choose good one among them ?(Sorry for poor English)
Please Guys Please read the question properly before make it as duplicate I already aware that ActionResult is more general version of JsonResult.My question is to know witch one is conventionally best to do the job done as clean way of coding and performance ...etc.