public ActionResult AddVideoGame(VideoGameLongDetailsDTO videoGame) { var allCategory = _categoryService.GetAllByMainCategoryId(3); List <SelectListItem> category = (from i in allCategory select new SelectListItem { Value = i.Id.ToString(), Text = i.Name }).ToList(); ViewBag.Category = category; if (!ModelState.IsValid) { return(View(videoGame)); } VideoGame addVideoGame = new VideoGame(); addVideoGame.VideoGameName = videoGame.VideoGameName; addVideoGame.VideoGameDescription = videoGame.VideoGameDescription; addVideoGame.CategoryId = videoGame.CategoryId; addVideoGame.ImageURL = FileHelper.Add(Request.Files[0], "VideoGame"); addVideoGame.IMDBScore = videoGame.IMDBScore; addVideoGame.VideoURL = videoGame.VideoURL; addVideoGame.ReleaseDate = videoGame.ReleaseDate; addVideoGame.IsActive = true; addVideoGame.CreatedDate = DateTime.Now; _videoGameService.Add(addVideoGame); TempData["AddedMessage"] = $"{addVideoGame.VideoGameName} Oyunu başarıyla eklendi"; return(RedirectToAction("VideoGameList", "VideoGame")); }