@@ -63,6 +63,11 @@ public Dictionary<string, string> GetSurveys() {
6363 return  GetFromSession < Dictionary < string ,  string > > ( "SurveyStorage" ,  surveys ) ; 
6464 } 
6565
66+  public  Dictionary < string ,  List < string > >  GetResults ( )  { 
67+  Dictionary < string ,  List < string > >  results  =  new  Dictionary < string ,  List < string > > ( ) ; 
68+  return  GetFromSession < Dictionary < string ,  List < string > > > ( "ResultsStorage" ,  results ) ; 
69+  } 
70+ 
6671 public  string  GetSurvey ( string  surveyId )  { 
6772 return  GetSurveys ( ) [ surveyId ] ; 
6873 } 
@@ -78,5 +83,19 @@ public void DeleteSurvey(string surveyId) {
7883 storage . Remove ( surveyId ) ; 
7984 session . SetString ( "SurveyStorage" ,  JsonConvert . SerializeObject ( storage ) ) ; 
8085 } 
86+ 
87+  public  void  PostResults ( string  postId ,  string  resultJson )  { 
88+  var  storage  =  GetResults ( ) ; 
89+  if ( ! storage . ContainsKey ( postId ) )  { 
90+  storage [ postId ]  =  new  List < string > ( ) ; 
91+  } 
92+  storage [ postId ] . Add ( resultJson ) ; 
93+  session . SetString ( "ResultsStorage" ,  JsonConvert . SerializeObject ( storage ) ) ; 
94+  } 
95+ 
96+  public  List < string >  GetResults ( string  postId )  { 
97+  var  storage  =  GetResults ( ) ; 
98+  return  storage . ContainsKey ( postId )  ?  storage [ postId ]  :  new  List < string > ( ) ; 
99+  } 
81100 } 
82101} 
0 commit comments