public async Task <IActionResult> Edit(int id, [Bind("id,email,lozinka")] AdministratorDB administratorDB) { if (id != administratorDB.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(administratorDB); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdministratorDBExists(administratorDB.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(administratorDB)); }
public async Task <IActionResult> Create([Bind("id,email,lozinka")] AdministratorDB administratorDB) { if (ModelState.IsValid) { _context.Add(administratorDB); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(administratorDB)); }