public async Task <IActionResult> Edit(int id, Inventario inventario)
        {
            if (!ModelState.IsValid)
            {
                var centrosDeCustos = await _centroDeCustoService.FindAllAsync(EmpresaId);

                var funcionarios = await _funcionarioService.FindAllAsync(EmpresaId);

                var viewModel = new InventarioFormViewModel {
                    Inventario = inventario, CentrosDeCustos = centrosDeCustos, Funcionarios = funcionarios
                };
                return(View(viewModel));
            }
            if (id != inventario.Id)
            {
                return(BadRequest());
            }
            try
            {
                await _inventarioService.UpdateAsync(inventario);

                return(RedirectToAction(nameof(Create), "InventariosItens", new { inventarioId = inventario.Id }));
            }
            catch (ApplicationException e)
            {
                return(RedirectToAction(nameof(Error), new { message = e.Message }));
            }
        }