コード例 #1
0
ファイル: HomeModule.cs プロジェクト: Rouz1130/mad-libs
 public HomeModule()
 {
     Get["/form"] = _ => {
     return View["form.cshtml"];
       };
       Get["/story"] = _ => {
     StoryVariables myStoryVariables = new StoryVariables();
     myStoryVariables.SetPerson1(Request.Query["person1"]);
     myStoryVariables.SetPerson2(Request.Query["person2"]);
     myStoryVariables.SetAnimal(Request.Query["animal"]);
     myStoryVariables.SetExclamation(Request.Query["exclamation"]);
     myStoryVariables.SetVerb(Request.Query["verb"]);
     myStoryVariables.SetNoun(Request.Query["noun"]);
     return View["story.cshtml", myStoryVariables];
       };
 }
コード例 #2
0
ファイル: HomeModule.cs プロジェクト: Rick1970/mad_libs
 public HomeModule()
 {
     Get["/form"] = _ => {
     return View["form.cshtml"];
       };
       Get["/story"] = _ => {
     StoryVariables myStoryVariables = new StoryVariables
     {
       Person1 = Request.Query["person1"],
       Person2 = Request.Query["person2"],
       Animal = Request.Query["animal"],
       Exclamation = Request.Query["exclamation"],
       Verb = Request.Query["verb"],
       Noun = Request.Query["noun"]
     };
     return View["story.html", myStoryVariables];
       };
 }
コード例 #3
0
 public HomeModule()
 {
     Get["/form"]= _ => {
     return View["form.cshtml"];
       };
       Get["/excellent_story"]=_=>{
     StoryVariables myStoryVariables = new StoryVariables
     {
       Person1 = Request.Query["person1"],
       Person2 = Request.Query["person2"],
       Adjective = Request.Query["adjective"],
       PluralFood = Request.Query["pluralFood"],
       HistoricalFigure = Request.Query["historicalFigure"],
       Animal = Request.Query["animal"],
       Exclamation = Request.Query["exclamation"],
       Verb = Request.Query["verb"],
       TimePeriod = Request.Query["timePeriod"]
     };
     return View["story.cshtml", myStoryVariables];
       };
 }