public async Task <IActionResult> Edit(int id, [Bind("VideoID,Name,Url,Level,PreReqs,Description,IsActive")] SlingVideos slingVideos) { if (id != slingVideos.VideoID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(slingVideos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SlingVideosExists(slingVideos.VideoID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(slingVideos)); }
public async Task <IActionResult> Create([Bind("VideoID,Name,Url,Level,PreReqs,Description,IsActive")] SlingVideos slingVideos) { if (ModelState.IsValid) { _context.Add(slingVideos); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(slingVideos)); }