public async Task <IActionResult> Edit(int id, [Bind("Id,Idsocial,Link,Isactive,Description")] Socialweb socialweb) { if (id != socialweb.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(socialweb); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SocialwebExists(socialweb.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Idsocial"] = new SelectList(_context.Socials, "Id", "Name", socialweb.Idsocial); return(View(socialweb)); }
public async Task <IActionResult> Create([Bind("Id,Idsocial,Link,Isactive,Description")] Socialweb socialweb) { if (ModelState.IsValid) { _context.Add(socialweb); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Idsocial"] = new SelectList(_context.Socials, "Id", "Name", socialweb.Idsocial); return(View(socialweb)); }