Exemplo n.º 1
0
        public IEnumerable <StageDto> GetAllByEventDate(int event_date_id)
        {
            try
            {
                IEnumerable <Stage> stages = _repository.GetAllByEventDate(event_date_id);

                if (stages == null)
                {
                    _logger.LogError($"stages with EventDate id: {event_date_id}, hasn't been found in db.");
                    return(null);
                }

                _logger.LogInfo($"Returned stages with EventDate id: {event_date_id}");

                IEnumerable <StageDto> Result = _mapper.Map <IEnumerable <StageDto> >(stages);
                return(Result);
            }
            catch (Exception ex)
            {
                _logger.LogError($"Something went wrong inside GetStageByEventDate action: {ex.Message}");
                throw new Exception();
            }
        }