Beispiel #1
0
        public IActionResult Edit(int id, VideoEditViewModel model)

        {
            var video = _videos.Get(id);

            if (video == null || !ModelState.IsValid)
            {
                return(View(model));
            }

            video.Title = model.Title; video.Genre = model.Genre;

            _videos.Commit();

            return(RedirectToAction("Details", new { id = video.Id }));
        }