示例#1
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var guias = await _guiaRepository.GetAsync();

                var results = _mapper.Map <GuiaDto[]>(guias);

                //return base.Ok();
                return(Ok(results));
            }
            catch (System.Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Falha no banco de dados, detalhes : {ex.Message}"));
            }
        }
示例#2
0
    public async Task PerformService(string schedule)
    {
        try
        {
            _logger.Info($"{DateTime.Now}: The PerformService() is called with {schedule} schedule");

            if (!string.IsNullOrWhiteSpace(schedule))
            {
                var guias = await _guiaRepository.GetAsync();

                //await UploadToAzureBlobStorage(schedule, path, fileName);
                _logger.Info($"{DateTime.Now}: The PerformService() is finished with {schedule} schedule");
            }
        }
        catch (Exception ex)
        {
            _logger.Info($"{DateTime.Now}: Exception is occured at PerformService(): {ex.Message}");
            throw new CustomConfigurationException(ex.Message);
        }
    }