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