// GET: Reward public ActionResult Index() { List <RewardViewModel> list = new List <RewardViewModel>(); var r = rewardService.GetAll(); foreach (var i in r) { RewardViewModel rewardModel = new RewardViewModel(); if (i.IdReward == 3) { rewardModel.Price1 = i.Price1; rewardModel.Price2 = i.Price2; rewardModel.Price3 = i.Price3; rewardModel.titre = i.titre; list.Add(rewardModel); } } return(View(list)); }