//Create - Sincrono public async Task <IActionResult> Create() { Session(); var clientes = await _clienteService.FindAllAsync(); var viewModel = new ComandaFormViewModels { Clientes = clientes }; return(View(viewModel)); }
//Edit - Assincrono public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var comanda = await _comandaService.FindByIdAsync(id.Value); if (comanda == null) { return(NotFound()); } var clientes = await _clienteService.FindAllAsync(); var viewModel = new ComandaFormViewModels { Comanda = comanda, Clientes = clientes }; return(View(viewModel)); }