public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Type,Organisation,Oblast,City,Street")] CkladSet ckladSet) { if (id != ckladSet.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ckladSet); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CkladSetExists(ckladSet.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ckladSet)); }
public async Task <IActionResult> Create([Bind("Id,Name,Type,Organisation,Oblast,City,Street")] CkladSet ckladSet) { if (ModelState.IsValid) { _context.Add(ckladSet); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ckladSet)); }