public async Task <IActionResult> Create([Bind("EmployeeId,Firstname,Lastname")] Employee employee) { if (ModelState.IsValid) { _context.Add(employee); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employee)); }
public async Task <IActionResult> Create([Bind("ScheduleId,Title,StartDate,EndDate,DurationHours,RepeatAfterDays,EmployeeId")] Schedule schedule) { if (ModelState.IsValid) { _context.Add(schedule); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(schedule)); }