public IActionResult Index() { Dictionary <string, int> surveyCount = surveyDAL.GetSurveyPosts(); IList <SurveyPark> surveyParks = new List <SurveyPark>(); foreach (KeyValuePair <string, int> kvp in surveyCount) { var parkCount = parkDAL.GetPark(kvp.Key); SurveyPark surveyList = new SurveyPark(); surveyList.surveyPark = parkCount; surveyList.Count = kvp.Value; surveyParks.Add(surveyList); } return(View(surveyParks)); }
public IActionResult SurveyResults() { //call dal and return list of parks codes and counts Dictionary <string, int> surveyCount = _surveyDal.GetSurveyResults(); IList <SurveyPark> surveyParks = new List <SurveyPark>(); foreach (KeyValuePair <string, int> kvp in surveyCount) { var park = _parkDal.GetPark(kvp.Key); SurveyPark sp = new SurveyPark(); sp.Park = park; sp.Count = kvp.Value; surveyParks.Add(sp); } return(View(surveyParks)); }