Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

MapRoute missing overload #217

Closed
pantonis opened this issue Oct 8, 2015 · 10 comments
Closed

MapRoute missing overload #217

pantonis opened this issue Oct 8, 2015 · 10 comments
Labels

Comments

@pantonis
Copy link

pantonis commented Oct 8, 2015

Hi,

I have noticed that on RouteBuilderExtensions MapRoute method string[] namespaces overload is missing. Any plans for it?

@rynowak
Copy link
Member

rynowak commented Oct 8, 2015

In vNext, areas are determined by [Area(...)] on your controller, so this feature isn't really relevant anymore. So no, no plans to bring it back 😆

@pantonis
Copy link
Author

pantonis commented Oct 8, 2015

But what If I have the controllers on a different assembly how do I achieve that without the namespaces overload?

@danroth27
Copy link
Member

Instead of using a list of namespaces to group your controllers we recommend using Areas. You can attribute your controllers (regardless of which assembly they are in) with a specific Area and then create a route for that Area.

You can see a test website that shows an example of using Areas in MVC 6 here: https://github.com/aspnet/Mvc/tree/dev/test/WebSites/RoutingWebSite.

Does this work for your scenario?

@pantonis
Copy link
Author

pantonis commented Oct 8, 2015

Thanks for the example.
It is a very good solution but unfortunately it does not work for my scenario. Reason is I want to keep each route into a different assembly. This is for authorization purposes as the system is huge and several clients need to have only specific dlls thus routes.

@pantonis
Copy link
Author

pantonis commented Oct 8, 2015

And I suppose Im not the only one out there having this requirement :)

@danroth27
Copy link
Member

I think you could still do that with Areas - you could have an Area and route for the controllers in each assembly, right?

@pantonis
Copy link
Author

pantonis commented Oct 8, 2015

Could you give me an example?

@pantonis
Copy link
Author

pantonis commented Oct 9, 2015

I dont think that's a solution really. Areas they have to be marked in each and every one controller. I don't want to use attribute routing. What I want is to map routes according to some parameters. Each route is on a different assembly as I described above.

@pantonis
Copy link
Author

pantonis commented Oct 9, 2015

Nevermind. I used attribute routing for areas only. Created a sample. If you wish I can send it to include it in the examples.

@danroth27
Copy link
Member

Cool - going to go ahead and close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants