public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Formula,Description")] Gase gase) { if (id != gase.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gase); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GaseExists(gase.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gase)); }
public async Task <IActionResult> Create([Bind("Id,Name,Formula,Description")] Gase gase) { if (ModelState.IsValid) { _context.Add(gase); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gase)); }