The codegenerator project uses attributes to generate routes. For example:

[PatternRoute("ShowProductsInCategory", "/<category>/products")]
public void ShowProductsInCategoryAction(string category) {
}

running the codegenerator creates the following on your sitemap:

public partial class ShowProductsInCategoryRoute :
Castle.MonoRail.Framework.Routing.PatternRoute {
    public ShowProductsInCategoryRoute() :
        base("ShowProductsInCategory", "<category>/products") {
    }

    public partial class RequiredParameters {
        public const string category = "category";
    }

    public partial class OptionalParameters {
    }
}

public static ShowProductsInCategoryRoute ShowProductsInCategory {
    get {
        return new ShowProductsInCategoryRoute();
    }
}

which you register in global.asax like:

RoutingModuleEx.Engine.Add(RouteDefinitions.ShowProductsInCategory);

and you can generate at runtime by doing:

TypedPropertyBag.ProductsLink = new
Routes(Context).ShowProductsInCategory("cars");

2008/10/23 hammett <[EMAIL PROTECTED]>

>
> I remember some discussions towards this, but couldnt find any
> code/sample. I was think that this might be a right step towards
> ambiguity resolution.
> Can you refer me to some code/sample on how you're using this?
>
> --
> Cheers,
> hammett
> http://hammett.castleproject.org/
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Development List" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to