Exemple #1
0
        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));
     }
 }
Exemple #3
0
 public List <ClassesQueryViewModel> GetAll(int userId)
 {
     return(_mapper.Map <List <ClassesQueryViewModel> >(_classesRepository.GetAll(userId)));
 }
Exemple #4
0
        public async Task <IActionResult> Get()
        {
            var classes = await _repository.GetAll();

            return(Ok(classes));
        }