public async Task <IActionResult> Create() { var setor = await _setorService.FindAllAsync(); var horario = await _horarioService.FindAllAsync(); var viewModel = new FuncionarioFormViewModel { Setores = setor, Horarios = horario }; return(View(viewModel)); }
public async Task <IActionResult> Get() { try { var setores = await _service.FindAllAsync(); return(Ok(setores)); } catch (ApplicationException e) { return(BadRequest(e.Message)); } }