ViewResult is an ASP.NET Core MVC action result that tells the framework to render a Razor view. It can carry an optional view name and a view model: a plain CLR object containing the data passed to the template. section 19.4
A controller action typically uses ViewResult in one of these ways:
- Return View() to let MVC select a view by convention. section 19.6
- Return View(model) to select the conventional view and pass it a view model. section 19.2
Returning a view with a model
public IActionResult Index() { var model = new ToDoListModel(); return View(model); } MVC receives the ViewResult, locates the Razor view, passes the model to it, and executes the template to generate HTML. section 19.4
Without an explicit name, MVC looks for a view named after the action method, under a folder named after the controller or in the Shared folder. Razor Pages use PageResult instead: their associated view is fixed and receives the PageModel. section 19.4

