Ejemplo n.º 1
0
        public IActionResult OnPost()
        {
            if (ModelState.IsValid)
            {
                TempData["CommitMessage"] = Video.Id > 0 ? "Video Updated" : "Video Added";
                _ = Video.Id > 0 ? _videoData.UpdateVideo(Video) : _videoData.AddVideo(Video);
                _ = _videoData.Save();

                return(RedirectToPage("./Detail", new { videoId = Video.Id }));
            }
            Genres = _helper.GetEnumSelectList <MovieGenre>();
            return(Page());
        }