예제 #1
0
        public IActionResult Index()
        {
            // classService.InitialClasses();
            var mentors = mentorService.AllMentors();
            var classes = classService.AllClasses();

            return(View("Index", new SchedulerViewModel(mentors, classes)));
        }
예제 #2
0
 public ActionResult <IEnumerable <ClassDto> > GetClasses()
 {
     try {
         var classes = _serviceClass.AllClasses();
         var results = _mapper.Map <IEnumerable <Class>, IEnumerable <ClassDto> >(classes);
         return(Ok(results));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex.Message);
         return(BadRequest(ex.Message));
     }
 }