Esempio n. 1
0
        public async Task <IActionResult> GetById(
            [FromServices] IGetDepartamentByIdUseCaseAsync getAsync,
            int id)
        {
            var result = await getAsync.RunAsync(id);

            if (result == null)
            {
                return(NotFound(result));
            }

            if (_notificationMessages.HasNotification())
            {
                return(BadRequest(_notificationMessages.Notications()));
            }
            _logger.LogInformation("Find department by id");
            return(Ok(result));
        }
Esempio n. 2
0
        public async Task <IActionResult> GetEmployerById(
            [FromServices] IGetEmployerByIdUseCaseAsync getEmployer,
            int id)
        {
            _logger.LogDebug("Search employer by id");
            var result = await getEmployer.RunAsync(id);

            if (result is null)
            {
                return(NotFound());
            }

            if (_notificationMessages.HasNotification())
            {
                return(BadRequest(_notificationMessages.Notications()));
            }

            return(Ok(result));
        }