public IActionResult OnPost(IFormFile fileEpisode) { if (!ModelState.IsValid || fileEpisode == null) { return(Page()); } if (_courseSerervice.ChecExistFile(fileEpisode.FileName)) { ViewData["IsExistfile"] = true; return(Page()); } _courseSerervice.AddEpisode(CourseEpisode, fileEpisode); return(Redirect("/Admin/Courses/IndexEpisode/" + CourseEpisode.CourseId)); }