public async Task <IActionResult> Edit(int id, [Bind("Id,PostDate,UserName,Header,TopicTitle,MessageContent,Rating,Agree,Disagree")] ReviewsForum reviewsForum) { if (id != reviewsForum.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reviewsForum); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReviewsForumExists(reviewsForum.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(reviewsForum)); }
public IActionResult Create() { ReviewsForum forum = new ReviewsForum { PostDate = DateTime.Now }; return(View(forum)); }
public async Task <IActionResult> Create([Bind("Id,PostDate,UserName,Header,TopicTitle,MessageContent,Rating,Agree,Disagree")] ReviewsForum reviewsForum) { if (ModelState.IsValid) { _context.Add(reviewsForum); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(reviewsForum)); }