public async Task <IActionResult> Edit(int id, [Bind("Id,Firm,Model,Quantity,Cost,Processor,RAM,VRAM,Graphics")] ComputersSet computersSet) { if (id != computersSet.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(computersSet); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ComputersSetExists(computersSet.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(computersSet)); }
public async Task <IActionResult> Create([Bind("Id,Firm,Model,Quantity,Cost,Processor,RAM,VRAM,Graphics")] ComputersSet computersSet) { if (ModelState.IsValid) { _context.Add(computersSet); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(computersSet)); }