示例#1
0
        public object Put(SaveCourse request)
        {
            var success = _courseManager.Update(request.Course);

            var issues = _messageBusService.Fetch().Select(m => m.Details); ;

            return new ServiceResult<Course>
            {
                Success = success,
                Result = request.Course,
                Errors = issues
            };
        }
示例#2
0
        public object Post(SaveCourse request)
        {
            int id;
            var success = _courseManager.Create(request.Course, out id);

            if (success)
                request.Course.ID = id;

            var issues = _messageBusService.Fetch().Select(m => m.Details); ;

            return new ServiceResult<Course>
            {
                Success = success,
                Result = request.Course,
                Errors = issues
            };
        }