heymagurany / RegexRouting

Define your routes using regular expressions in ASP.NET MVC and Web API.
MIT License
1 stars 0 forks source link

DataTokens are required in order to find areas elements #4

Closed chrilith closed 11 years ago

chrilith commented 11 years ago

I also changed the way the URL is handled so that "url" and "pattern" use the same pattern (without ~/)

UseLegacy is here to support the old format.

With all those changes (and previous pull requests) we have full support of Areas

heymagurany commented 11 years ago

Thanks! I know areas needed to be supported eventually.

chrilith commented 11 years ago

Thank you for your simple but yet useful package.

heymagurany commented 11 years ago

Thanks for contributing! Now that I know someone finds it useful, I will get back to work. I would really like to add a module to specifically support ASP.NET MVC and another to support ASP.NET Web API, which is why I don't have the RouteCollectionExtension class added to the project yet. As you noticed, the project doesn't support Web API correctly. I'm going to open a couple issues and get started on this work.

heymagurany commented 11 years ago

Also, I'll get your changes published into the NuGet package over the weekend.

chrilith commented 11 years ago

Great thank you!

Even if you don't commit WebAPI related suff, perhaps you can commit the extensions (MapRegexRoute methods) which are quite useful and add them NuGet removing the WebAPI related stuff?

I really want to use your package using NuGet only.

heymagurany commented 11 years ago

I will make that change and commit it within the next couple of days. Probably this weekend.

heymagurany commented 11 years ago

I changed the matching URL to include the beginning slash. My use case needs the slash in the resulting parameter.

chrilith commented 11 years ago

I understand. But I think it is more natural to work on the same url schgeme for both Url and Pattern parameters. To keep compatibility with earlier versions I added the UseLegacy option so that the only change to do is adding this option in your cod and keep your patterns as is. Could you use UseLegacy instead?

heymagurany commented 11 years ago

I did end up keeping the UseLegacy flag, but it only removes the tilde. I do see your point, however. What I would like to do is have a Route that only uses the Regex to match the URL and to generate the URL. I haven't spent a ton of time on it, but I don't have any great ideas.

I wonder if we could create a different Route implementation for what I want and change the RegexRoute class back to your implementation.

Any thoughts on how to generate a URL from the regex?

chrilith commented 11 years ago

Well, originally I removed ~/ to match the Url parameter. then you changed to add the a slash back.

About creating Url based on Pattern, it is simply impossible :), regex are way to complicated and too permissive to create a simple rule to extract Url.