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