public List <FilteredListViewModel> GetFilteredClasses(string keyword, int userId) { var classesList = keyword != null? _classRepository.GetClassByTitle(keyword) : _classRepository.GetAll(userId); return(_mapper.Map <List <FilteredListViewModel> >(classesList)); }
public ActionResult <Dictionary <string, IEnumerable <Classes> > > GetAllClasses() { try { var list = repository.GetAll(); Dictionary <string, IEnumerable <Classes> > result = new Dictionary <string, IEnumerable <Classes> >(); result.Add("Classes", list); return(Ok(result)); } catch (System.Exception msg) { return(NotFound(msg)); } }
public List <ClassesQueryViewModel> GetAll(int userId) { return(_mapper.Map <List <ClassesQueryViewModel> >(_classesRepository.GetAll(userId))); }
public async Task <IActionResult> Get() { var classes = await _repository.GetAll(); return(Ok(classes)); }