Esempio n. 1
0
        protected override void RegisterRoutes(RoutingEngine rules)
        {
            rules.Add(new PatternRoute("/")
                .DefaultForArea().IsEmpty
                .DefaultForController().Is<LoginController>()
                .DefaultForAction().Is("index"));

            rules.Add(new PatternRoute("/<controller>/<action>")
                        .DefaultForArea().IsEmpty
                        .DefaultForAction().Is("index")
                        .Restrict("controller").AnythingBut("MonoRail"));

            rules.Add(new PatternRoute("/<area>/<controller>/<action>")
                .DefaultForAction().Is("index")
                .Restrict("area").AnyOf("Administrator", "User"));
        }
Esempio n. 2
0
 private void RegisterRoutes(RoutingEngine engine)
 {
     engine.Add(new PatternRoute("/<controller>/[action]/[id]")
                    .DefaultForAction().Is("index")
                    .DefaultFor("id").Is(""));
 }