Author: Jon Galloway, Brad Wilson, K. Scott Allen, and David Matson
Full Title: Professional ASP.NET MVC 5
Category: #books
Highlights
Controllers within the MVC pattern are responsible for responding to user input, often making changes to the model in response to user input. In this way, controllers in the MVC pattern are concerned with the flow of the application, working with data coming in, and providing data going out to the relevant view. (Location 1101)
specify a view in a completely different directory structure. You can use the tilde syntax to provide the full path to the view, as follows: public ActionResult Index() { return View(”∼/Views/Example/Index.cshtml”); } (Location 1513)
create the ShoppingCartViewModel class, shown as follows: public class ShoppingCartViewModel { public IEnumerable Products { get; set; } public decimal CartTotal { get; set; } public string Message { get; set; } } Now you can make a view strongly typed to this model, using the following @model directive: @model ShoppingCartViewModel (Location 1644)
models as the objects you use to send information to the database, perform business calculations, and even render in a view. In other words, these objects represent the domain (Location 2084)