public async Task <IActionResult> Create([Bind("EntryID,Date,Text")] Entry entry) { if (ModelState.IsValid) { _context.Add(entry); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(entry)); }
public async Task <IActionResult> Create([Bind("DiaryID,Title,CreatedDate")] Diary diary) { if (ModelState.IsValid) { _context.Add(diary); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(diary)); }