public IActionResult Get() { var lectures = _lectureService.GetAll(); var lectureViewModelList = Mapper.Map <List <LectureViewModel> >(lectures); return(Ok(lectureViewModelList)); }
public async Task <ActionResult <IList <LectureModel> > > GetAll(int courseId = default) { if (courseId < 0) { ModelState.AddModelError(nameof(courseId), ""); return(BadRequest(ModelState)); } try { IList <LectureDto> dtos = courseId == default ? await _lectureService.GetAll() : await _lectureService.GetAllByCourse(courseId); var models = _mapper.Map <LectureModel[]>(dtos); return(models); } catch (IncorrectIdException e) { _logger.LogWarning(e, "It seems, validation does not cover some errors."); return(BadRequest(e.Message)); } }
public IActionResult GetAll() { return(Ok(_lectureService.GetAll())); }
public ActionResult <List <LectureDTO> > GetAll() { var lecture = _lectureService.GetAll(); return(Ok(lecture)); }
public async Task <ActionResult <List <SectionGroupModel> > > GetAll() { var groups = await lectureService.GetAll(); return(Ok(groups)); }