public IActionResult Index() { // classService.InitialClasses(); var mentors = mentorService.AllMentors(); var classes = classService.AllClasses(); return(View("Index", new SchedulerViewModel(mentors, classes))); }
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)); } }