public async Task <IActionResult> Edit(int id, [Bind("ID,DocumentName, Description")] SvgDocument svgDocument) { if (id != svgDocument.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(svgDocument); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SvgDocumentExists(svgDocument.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(svgDocument)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,DocumentId,AttributeName,AttributeInnerText,IsActive")] SvgElement svgElement) { if (!User.Identity.IsAuthenticated) { return(Forbid()); } if (id != svgElement.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(svgElement); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SvgElementExists(svgElement.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(svgElement)); }