public async Task HandleAsync(CourseUpdateLandingPageCommand command) { var course = _context.Course.FirstOrDefault(x => x.Id == command.CourseId); course.LandingPage = command.Content; await _context.SaveChangesAsync(); }
public async Task <IActionResult> UpdateLandingPage(int courseId, CourseUpdateLandingPageCommand command) { if (!_userResolver.HasCoursePrivilege(courseId, new List <PrivilegeEnum>() { PrivilegeEnum.CanManageCourse, PrivilegeEnum.CanManageCourseFiles, PrivilegeEnum.CanUploadCourseFiles })) { return(Unauthorized()); } await _commandBus.ExecuteAsync(command); return(Ok()); }