Exemplo n.º 1
0
        public async Task <Response <IEnumerable <GetCategoryViewModel> > > GetAll()
        {
            var categories = await _categoryRepository.GetAllAsync();

            var result = _mapper.Map <IEnumerable <GetCategoryViewModel> >(categories);

            return(new Response <IEnumerable <GetCategoryViewModel> >(result));
        }
Exemplo n.º 2
0
        public async Task <Response <IEnumerable <GetCategoryViewModel> > > GetAllCategories()
        {
            var categories = await _categoryRepository.GetAllAsync();

            var results = _mapper.Map <IEnumerable <GetCategoryViewModel> >(categories);

            return(new Response <IEnumerable <GetCategoryViewModel> >(results, "Operation Successfully"));
        }