public async Task <IActionResult> Create([Bind("IdProfesor,NameProfesor,EnrollDate")] Profesor profesor) { if (ModelState.IsValid) { _context.Add(profesor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(profesor)); }
public async Task <IActionResult> Create([Bind("Id,Name,Age,EnrollDate")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Create([Bind("Id,NCode,SCode,Name,Family,Father,Phone,Mobile,Address,isActive")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(student)); }