public async Task <IActionResult> Create([Bind("ReviewId,ContentId,Text,Created,Writer")] Review review) { if (ModelState.IsValid) { _context.Add(review); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(review)); }
public async Task <IActionResult> Create([Bind("ContentId,Title,Text,Created,Writer")] Content content) { if (ModelState.IsValid) { // content.Writer = User.Identity.Name; _context.Add(content); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(content)); }