public async Task <IActionResult> Edit(Guid id, [Bind("Id,EArticleId,Comment,DOComment,IsLegal")] EArticleComment eArticleComment) { if (id != eArticleComment.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(eArticleComment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EArticleCommentExists(eArticleComment.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(eArticleComment)); }
public async Task <IActionResult> Create([Bind("Id,EArticleId,Comment,DOComment,IsLegal")] EArticleComment eArticleComment) { if (ModelState.IsValid) { eArticleComment.Id = Guid.NewGuid(); _context.Add(eArticleComment); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(eArticleComment)); }