public virtual IActionResult GetAllCourses() { try { var coursesCommand = _courseAppService.GetAllCourses(); return(ReturnResponse(coursesCommand)); } catch (Exception e) { return(BadRequest("Error: " + e.Message)); } }
public async Task <ResponseBase <IEnumerable <Course> > > GetAll() { try { GetUserId(); var courses = await _courseAppService.GetAllCourses(); return(new ResponseBase <IEnumerable <Course> >() { IsSuccess = true, ErrorDetails = null, Payload = courses }); } catch (Exception ex) { LogError(ex); return(new ResponseBase <IEnumerable <Course> >() { ErrorDetails = Error(), IsSuccess = false, Payload = null }); } }
public ActionResult CourseList1(CourseSearchInput input) { var list = _courseAppService.GetAllCourses(input); return(Content(list.ToJson())); }
public async Task <IActionResult> GetAllCourses() { var result = await _courseAppService.GetAllCourses(); return(Ok(result)); }