public async Task <IActionResult> Index() { //busca items de algum lugar //se necessario criar uma view model //encaminha para view var vm = new ToDoViewModel { Items = await _toDoItemService.GetIncompleteItemAsync() }; return(View(vm)); }
public async Task <IActionResult> Index() { //Get to-do items from database var items = await _toDoItemService.GetIncompleteItemAsync(); //put items in model var model = new Models.ToDoViewModel() { Items = items }; //render view using model return(View(model)); }