public JsonResult Search(string searchString) { var vms = new List <VideoGameViewModel>(); var foundGames = VideoGameService.GetVideoGameByName(searchString); foreach (var game in foundGames) { var vm = new VideoGameViewModel(game); vm.PlatformName = PlatformService.Get(game.PlatformId).Name; vm.RatingName = RatingService.Get(game.RatingId).Name; vms.Add(vm); } return(Json(vms, JsonRequestBehavior.AllowGet)); }