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