public ActionResult Edit(VideoEdit videoEdit) { videoEdit.Validate(this); if (ModelState.IsValid) { int[] userIds; Video video = videoEdit.GetModel(out userIds); bool success = VideoCache.Update(Db, video, userIds); if (!success) { return RedirectToAccessDenied(); } return RedirectToAction("Index"); } PopulateUserIds(videoEdit.UserIds); return View(videoEdit); }
public static VideoEdit GetModelView(Video video, HttpServerUtilityBase server) { if (video == null) return null; var videoEdit = new VideoEdit(video, server); return videoEdit; }