public async Task <IActionResult> Create([Bind("Id,Title,Body,Feeling,WordCount,PostedOn")] Entry entry) { if (ModelState.IsValid) { _context.Add(entry); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(entry)); }
public async Task <IActionResult> Create([Bind("Id,UserName")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }