예제 #1
0
        public async Task <IEnumerable <CodeResource> > GetCodeResources()
        {
            var codes = await _repository.GetCodes();

            var result = _mapper.Map <IEnumerable <Code>, IEnumerable <CodeResource> >(codes);

            return(result);
        }
예제 #2
0
        public async Task <IActionResult> GetCode()
        {
            var Items = await _repo.GetCodes();

            var ItemsToReturn = _mapper.Map <IEnumerable <CodeForAddDto> >(Items);

            return(Ok(ItemsToReturn));
        }
예제 #3
0
 public async Task <Code[]> Codes([Inject] ICodeRepository repository)
 => _mapper.Map <Code[]>(await repository.GetCodes());
        public async Task <IEnumerable <CodeResource> > GetCodes(int parentId)
        {
            var codes = await _repository.GetCodes(parentId);

            return(_mapper.Map <IEnumerable <Code>, IEnumerable <CodeResource> >(codes));
        }