Example #1
0
        public virtual IEnumerable <GridDto> GetAll()
        {
            _logger.Debug($"Called GetAll() of {_type.Name}.");
            var result = _queryRepo.GetAll();

            if (result.IsSuccess == ResultType.OK)
            {
                var mapper = _mapperFactory.CreateMapperToGridDto();
                var dtos   = mapper.Map <IEnumerable <GridDto> >(result.ResultList);
                _logger.Info($"All {_type.Name} returned.");
                return(dtos);
            }
            throw new GetEntityException <Entity>(result.IsSuccess.ToString());
        }