public async Task <IActionResult> Edit(decimal id, [Bind("GROUPID,COMPONENTID,id")] GroupComponents groupComponents) { if (id != groupComponents.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(groupComponents); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GroupComponentsExists(groupComponents.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(groupComponents)); }
public async Task <IActionResult> Create([Bind("GROUPID,COMPONENTID,id")] GroupComponents groupComponents) { if (ModelState.IsValid) { _context.Add(groupComponents); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(groupComponents)); }