public async Task <IActionResult> GetAll() { var categorias = await _categoriaRepository.All(); if (categorias != null) { return(Ok(new ResultViewModel(true, "Categorias Lisadas com sucesso.", categorias))); } return(NoContent()); }
public IEnumerable <CategoriaViewModel> All(object param = null, Expression <Func <CategoriaViewModel, object> > selector = null, IDbTransaction transaction = null) { return(_mapper.Map <IEnumerable <CategoriaViewModel> >(_categoriaRepository.All(param: param, selector: _mapper.Map <Expression <Func <Categoria, object> > >(selector), transaction: transaction))); }