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