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