Esempio n. 1
0
        //Create - Sincrono
        public async Task <IActionResult> Create()
        {
            Session();
            var clientes = await _clienteService.FindAllAsync();

            var viewModel = new ComandaFormViewModels {
                Clientes = clientes
            };

            return(View(viewModel));
        }
Esempio n. 2
0
        //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));
        }