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

            return(Ok(classes));
        }