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