I am new to ASP.NET MVC. Could you explain what is the difference between ActionResult and ViewResult? Does it matter if use ActionResult as the return type for my actions instead of view. And what do you mean by rendering a view and returning a view?
These are two actions. Would it matter if i change the Index() type from ViewResult to ActionResult?
public ViewResult Index()
{
var customers = GetCustomers();
return View(customers);
}
public ActionResult Details(int id)
{
var customer = GetCustomers().SingleOrDefault(c => c.Id == id);
if (customer == null)
return HttpNotFound();
return View(customer);
}