public async Task <IActionResult> Create([Bind("ID,Name,Gender,Company,Department")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employee)); }
public async Task <IActionResult> Create([Bind("ID,Name,Color,Age")] Cat cat) { if (ModelState.IsValid) { _context.Add(cat); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(cat)); }