public ActionResult Edit(int id, EditVideosViewModel model) { try { //string FileName = UploadFile(model.File, model.VideoUrl); if (ModelState.IsValid) { var video = new Videos { Video = model.File, Title1 = model.Title1, Title2 = model.Title2, Description1 = model.Description1, Description2 = model.Description2 }; repository.Update(model.Id, video); return(RedirectToAction("index")); } return(View(model)); } catch { return(View()); } }
public ActionResult Edit(int id) { var video = repository.Find(id); if (video == null) { return(NotFound()); } var model = new EditVideosViewModel { Id = video.ID, File = video.Video, Title1 = video.Title1, Title2 = video.Title2, Description1 = video.Description1, Description2 = video.Description2 }; return(View(model)); }