示例#1
0
        public async Task <IEnumerable <ShowVacanciesDto> > Handle(GetAllVacancies request, CancellationToken cancellationToken)
        {
            try
            {
                var response = await _repository.GetAllAsync();

                if (response != null)
                {
                    var result = _mapper.Map <IEnumerable <ShowVacanciesDto> >(response);
                    return(result);
                }
                return(new List <ShowVacanciesDto>());
            }
            catch (Exception e)
            {
                _logger.LogError(nameof(GetAllVacanciesHandler.Handle), e);
                return(new List <ShowVacanciesDto>());
            }
        }