Esempio n. 1
0
    public HomeModule()
    {
      Get["/"] = _ =>
      {
        LetterVariables myLetterVariables = new LetterVariables
        {
          Recipient = "Bob",
          Sender = "John"
        };
        return View["hello.html", myLetterVariables];
      };

      Get["/form"] = _ =>
      {
        return View["form.html"];
      };

      Get["/greeting_card"] = _ =>
      {
        LetterVariables myLetterVariables = new LetterVariables
      {
        Sender = Request.Query["sender"],
        Recipient = Request.Query["recipient"]
      };
      return View["hello.html",  myLetterVariables];
      };
    }
Esempio n. 2
0
 public HomeModule()
 {
   Get["/"] = _ => {
     LetterVariables myLetterVariables = new LetterVariables {
       Recipient = "Eric",
       Sender = "John"
     };
     return View["hello.html", myLetterVariables];
   };
 }
Esempio n. 3
0
    public HomeModule()
    {
      Get["/"] = _ => {
    LetterVariables myLetterVariables = new LetterVariables();
    myLetterVariables.SetRecipient("Eric");
    myLetterVariables.SetSender("John");
    return View["hello.cshtml", myLetterVariables];
  };
  return View["hello.html", myLetterVariables];
};
Esempio n. 4
0
 public HomeModule()
 {
   Get["/hello"] = _ => View["hello2.html"];
   Get["/"] = _ => {
     LetterVariables myLetterVariables = new LetterVariables("I pity the fool!");
     myLetterVariables.Vacations.Add("Fiji");
     myLetterVariables.Vacations.Add("Bahamas");
     myLetterVariables.Vacations.Add("Austrailia");
     return View["hello.html", myLetterVariables];
   };
 }
Esempio n. 5
0
 public HomeModule()
 {
   Get["/greeting_card"] = _ => {
     var myLetterVariables = new LetterVariables
     {
       Sender = Request.Query["sender"],
       Recipient = Request.Query["recipient"]
     };
     return View["hello.html", myLetterVariables];
   };
   Get["/favorite_photos"] = _ => View["favorite_photos.html"];
   Get["/form"] = _ => View["form.html"];
 }
Esempio n. 6
0
 public HomeModule()
 {
   Get["/"] = _ => {
     LetterVariables myLetterVariables = new LetterVariables
     {
       Recipient = "Manny",
       Sender = "Andy",
       Places = "Greenland"
     };
     return View["friend-letter.html", myLetterVariables];
   };
   Get["/travel-photos"] = _ => View["travel-photos.html"];
 }
Esempio n. 7
0
 public HomeModule()
 {
   Get["/form"] = _ => {
     return View["form.html"];
   };
   Get["/hello"] = _ => {
     LetterVariables myLetterVariables = new LetterVariables
     {
       Sender = Request.Query["sender"],
       Recipient = Request.Query["recipient"]
     };
     return View["hello.html", myLetterVariables];
   };
 }
Esempio n. 8
0
 public HomeModule()
 {
     Get["/"] = _ => {
     LetterVariables myLetterVariables = new LetterVariables
                                         {
                                           user = "******"
                                         };
     return View["hello.html", myLetterVariables];
       };
       Get["/form"] = _ => View["form.html"];
       Get["/login"] = _ => {
     LetterVariables myLetterVariables = new LetterVariables
     {
     Username = Request.Query["username"],
     Password = Request.Query["password"]
     };
     return View["hello.html", myLetterVariables];
       };
 }