public async Task <IActionResult> Index() { var vm = new Models.View.ToDoViewModel() { Items = await _toDoItemService.GetIncompleteItemsAsync() }; return(View(vm)); }
public IActionResult Index() { var todoItems = await _todoItemService.GetIncompleteItemsAsync(); var model = new TodoViewModel() { Items = todoItems }; return(View(model)); }
public async Task <IActionResult> Index() { var items = await _todoItemService.GetIncompleteItemsAsync(); var model = new ToDoViewModel { ToDoItems = items }; return(View(model)); }
public async Task <IActionResult> Index() { //busca item de algum lugar //se necessario cura uma view model //encaminha para view var vm = new ToDoViewModel() { Items = await _toDoItemService.GetIncompleteItemsAsync() }; return(View(vm)); }
public async Task <IActionResult> Index() { var items = await _toDoItemService.GetIncompleteItemsAsync(); StringBuilder str = null; str.Append(""); return(View(new ToDoViewModel { Items = items })); }
//IActionResult public async Task <IActionResult> Index() { // Get to-do items from database var items = await _toDoItemService.GetIncompleteItemsAsync(); // Put items into a model var model = new ToDoViewModel() { Items = items }; return(View(model)); // Render view using the model }
public async Task <IActionResult> Index() { //Get todo Items var todoItems = await _toDoItemsService.GetIncompleteItemsAsync(); //Put into models var viewModel = new ToDoViewModel { Items = todoItems }; //Pass the view to model return(View(viewModel)); }
public async Task <IActionResult> Index() { //Get items from the db var ToDoItems = await _toDoItemService.GetIncompleteItemsAsync(); //Pass items to a model var model = new ToDoItemViewModel() { Items = ToDoItems }; //Render a view with the model data return(View(model)); }
public async Task <IActionResult> Index() { var currentUser = await _userManager.GetUserAsync(User); if (currentUser == null) { Challenge(); } var items = await _todoItemService.GetIncompleteItemsAsync(currentUser); return(View(new ToDoViewModel() { Items = items })); }
public async Task <IActionResult> Index() { var currentUser = await _userManager.GetUserAsync(User); if (currentUser == null) { return(Challenge()); } var items = await _toDoItemService.GetIncompleteItemsAsync(currentUser); var model = new ToDoViewModel { Items = items }; return(View(model));//check if it works straight with items. }
public async Task <IActionResult> Index() { var currentUser = await _userManager.GetUserAsync(User); if (currentUser == null) { return(Challenge()); } // busca items de algum lugar //se necessário cria uma view model // encaminha para a view var vm = new ToDoViewModel { Items = await _toDoItemService.GetIncompleteItemsAsync(currentUser) }; return(View(vm)); }
/// <summary>Action methods can return views, JSON data or HTTP status codes.</summary> public async Task <IActionResult> Index() { // Get to-do items from database /// <summary> /// Making calls over networks or to a database takes time. /// Make this call asynchronous as a result. /// </summary> var items = await _toDoItemService.GetIncompleteItemsAsync(); // Put items into a (view) model var viewModel = new ToDoViewModel { Items = items }; // Render view using the model /// <summary>Bind the model to the view.</summary> return(View(viewModel)); }
public async Task <IActionResult> Index() { //Obtiene el usuario actul var currentUser = await _userManager.GetUserAsync(User); //Verifica que halla un usuario logeado, //en caso contrario fuerza el logeo con Challenge(). if (currentUser == null) { return(Challenge()); } var items = await _todoItemService.GetIncompleteItemsAsync(currentUser); var model = new ToDoViewModel() { Items = items }; return(View(model)); }
public async Task <IActionResult> Index() { var currentUser = await _userManager.GetUserAsync(User); if (currentUser == null) { return(Challenge()); } // Acessar os dados var todoItems = await _todoItemsService.GetIncompleteItemsAsync(currentUser); // Montar uma Model var viewModel = new ToDoViewModel { Items = todoItems }; // Retornar View return(View(viewModel)); }