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