Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PathHelpers class to be public for IEntryPointResolver implementation #49

Open
lvv83 opened this issue Jan 20, 2015 · 5 comments
Open

Comments

@lvv83
Copy link

lvv83 commented Jan 20, 2015

Hello.
Can you change class modifier from internal to public for PathHelpers class?
I need to implement new IEntryPointResolver (#31) interface. And I should duplicate path logic which already in this internal helper class.

@CezarCretu
Copy link
Contributor

That class is internal for a very good reason: the methods that it contains are implementation details that I don't intend to support as a public API. What exactly are you after?

@lvv83
Copy link
Author

lvv83 commented Jan 20, 2015

Well. I need to integrate RequireJsNET with MvcCodeRouting library. To do this I wrote an implementation of the IEntryPointResolver.

@gregveres
Copy link

Hi @CezarCretu

I too am now writing my own IEntryPointResolver to support having a different .js file loaded when a mobile version of the .cshtml file is loaded.

For instance, when Player/Index is loaded on a desktop, it loads Index.cshtml, but when that same controller action is called on a mobile, Index.mobile.cshtml is loaded. Since a different view is being loaded, I need the ability to load a different set of javascript code.

No problem, I will just write my own IEntryPointResolver and trigger off of viewContext.DisplayMode.DisplayModeId == "Mobile".

But then I run into the same thing that @lvv83 is asking for above. I need to get the Controller and the Action for the request. We don't need to get access to any other details. In fact, maybe the signature of IEntryPointResolver should change to include these things as part of its interface. I would imagine you can't do too much interesting with the entry point resolver without knowing the controller, action and area of the request. So either we have to duplicate the code in our project, or we get it passed in as part of the information provided to make the resolver decision, or it is available through one of the supplied classes like GetRoutingInfo().

Thanks for listening.
Greg

@CezarCretu
Copy link
Contributor

Sorry @gregveres, I am no longer maintaining/using this library. You can try pinging @stefanprodan or @cristipufu, maybe they can help.

@gregveres
Copy link

Ok, thanks for the heads up. Good luck with your other projects. @CezarCretu

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

No branches or pull requests

3 participants