public async Task <IActionResult> Edit(long id, [Bind("KodRiska,Naimenovanie,Opisanie,SrednyayaVeroyatnost")] Riski riski) { if (id != riski.KodRiska) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(riski); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RiskiExists(riski.KodRiska)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(riski)); }
public async Task <IActionResult> Create([Bind("KodRiska,Naimenovanie,Opisanie,SrednyayaVeroyatnost")] Riski riski) { if (ModelState.IsValid) { _context.Add(riski); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(riski)); }