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