示例#1
0
        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
                });
            }
        }
示例#3
0
        public ActionResult CourseList1(CourseSearchInput input)
        {
            var list = _courseAppService.GetAllCourses(input);

            return(Content(list.ToJson()));
        }
示例#4
0
        public async Task <IActionResult> GetAllCourses()
        {
            var result = await _courseAppService.GetAllCourses();

            return(Ok(result));
        }