コード例 #1
0
        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));
        }
コード例 #2
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var setores = await _service.FindAllAsync();

                return(Ok(setores));
            }
            catch (ApplicationException e)
            {
                return(BadRequest(e.Message));
            }
        }