public async Task <IActionResult> PutStudyGroupComment([FromRoute] int id, [FromBody] StudyGroupComment studyGroupComment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != studyGroupComment.Id) { return(BadRequest()); } _context.Entry(studyGroupComment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudyGroupCommentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void HandlePostNewCommand() { if (NewComment.Comment == null) { return; } Task.WaitAll(PostNewComment()); NewComment = new StudyGroupComment(); GetComments(); }
public async Task <IActionResult> PostStudyGroupComment([FromBody] StudyGroupComment studyGroupComment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.StudyGroupComment.Add(studyGroupComment); await _context.SaveChangesAsync(); return(CreatedAtAction("GetStudyGroupComment", new { id = studyGroupComment.Id }, studyGroupComment)); }
public ViewStudyGroupDetailsViewModel(StudyGroupView studyGroupView, IPageService pageService) { _pageService = pageService; HandleAddCommandButtonCommand = new Command(HandlePostNewCommand); NewComment = new StudyGroupComment(); HandleSeeAllAttendantsCommand = new Command(HandleSeeAllAttendants); AttendButtonCaption = "Join"; CommentsEmpty = false; StudyGroupView = studyGroupView; GetMiniStudentViewAttendants(); GetComments(); InitIsAttendantAsync(); HandleAttendantButtonCommand = new Command(HandleAttendantButton); }