Exemplo n.º 1
0
    public HomeModule()
    {
      Get["/"] = _ => {
        return View["rectangle_form.cshtml"];
      };
      Get["/rectangle_result"] = _ => {
        Dictionary<string, object> Shapes = new Dictionary<string, object>();
        Rectangle myRectangle = new Rectangle(Request.Query["side-length"], Request.Query["side-width"]);
        Shapes.Add("ResultingRectangle", myRectangle);

        if (myRectangle.IsSquare()) {
          Cube myCube = new Cube(myRectangle);
          Shapes.Add("ResultingCube", myCube);
        }
        return View["rectangle_result.cshtml", Shapes];
      };
    }
        public HomeModule()
        {
            Get["/"] = _ => {
            return View["index.cshtml"];
              };
              Get["/rectangle"] = _ => {
            Dictionary<string, object> shapes = new Dictionary<string, object>();
            Rectangle myRectangle = new Rectangle(Request.Query["side-length"], Request.Query["side-width"]);
            shapes.Add("shape1", myRectangle);

            if (myRectangle.IsSquare()) {
              Cube myCube = new Cube(myRectangle);
              shapes.Add("shape2", myCube);
            }
            return View["rectangle.cshtml", shapes];
              };
        }