Can I get contrib commit access? One thing I noticed is that using
int as validation try's to call ValidInt instead of ValidInteger. I
am also missing the MyRoutes now and Site.Routes.
--
Truth,
James
[PatternRoute("Foo", "feed/foo/<id>")
public void Foo() {}
[PatternRoute("Bar", "feed/bar/<id>")
public void Bar() {}
If i call now Routes.Foo() or Route.Bar() if always get the same url. This is because the generates generates this:
public virtual string Foo(string id) {
System.Collections.IDictionary routeParameters Castle.MonoRail.Framework.Helpers.DictHelper.Create();
routeParameters.Add("id", id);
return this.engineContext.Services.UrlBuilder.BuildUrl(this.engineContext.UrlInfo, new System.Collections.Hashtable(), routeParameters);
}
public virtual string Bar(string id) {
System.Collections.IDictionary routeParameters Castle.MonoRail.Framework.Helpers.DictHelper.Create();
routeParameters.Add("id", id);
return this.engineContext.Services.UrlBuilder.BuildUrl(this.engineContext.UrlInfo, new System.Collections.Hashtable(), routeParameters);
}
And on my perspective this calls are the same. I think this calls must be look like this:
public virtual string Foo(string id) {
System.Collections.IDictionary routeParameters Castle.MonoRail.Framework.Helpers.DictHelper.Create();
routeParameters.Add("id", id);
return RouteDefinitions.Foo.CreateUrl( routeParameters );
}
public virtual string Bar(string id) {
System.Collections.IDictionary routeParameters Castle.MonoRail.Framework.Helpers.DictHelper.Create();
routeParameters.Add("id", id);
return RouteDefinitions.Foo.CreateUrl( routeParameters );
}
I someone can confirm this i will look forward to write a patch for it.
Steve
Lee Henson schrieb:
Steve
Lee Henson schrieb:
I also have a few other things in my head which the generator can be
extend and i list them here. Possibly you find the time and interest to
code them before i get time to do it.
* RouteDefinitions.AddAll(RoutingEngine engine)
* Add a sample project which demonstrates how to use the generator
* Generate a the needed SiteMapControllerBase into SiteMap.generated.cs
(The Controller which provides access to Site and Routes)
* Routes.Foo should return a IRouteActionReference and
IArgumentlessRouteActionReference insted of a string
* Extend IArgumentlessControllerActionReference with "RouteUrl"
By
Steve
Lee Henson schrieb:
Hi Lee thanks for doing it! I am too busy at the moment and i could test
it first next week.
I also have a few other things in my head which the generator can be
extend and i list them here. Possibly you find the time and interest to
code them before i get time to do it.
* RouteDefinitions.AddAll(RoutingEngine engine)
* Add a sample project which demonstrates how to use the generator
* Generate a the needed SiteMapControllerBase into SiteMap.generated.cs
(The Controller which provides access to Site and Routes)
* Routes.Foo should return a IRouteActionReference and
IArgumentlessRouteActionReference insted of a string
* Extend IArgumentlessControllerActionReference with "RouteUrl"
Lee Henson schrieb: