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