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

Move IUrlHelper to an abstractions assembly #4214

Closed
strohhut opened this issue Mar 3, 2016 · 4 comments
Closed

Move IUrlHelper to an abstractions assembly #4214

strohhut opened this issue Mar 3, 2016 · 4 comments
Assignees
Milestone

Comments

@strohhut
Copy link

strohhut commented Mar 3, 2016

I have a standard class library that provides ASP.NET specific utility methods that are independent from the app specific logic of concrete ASP.NET projects. For example I have a bunch of extension methods for HttpRequest.

Would it be possible to move IUrlHelper to an abstractions assembly so I can implement utility methods outside of the web project that require an IUrlHelper? Otherwise I have to implement my own IUrlHelper interface in my class library and then a class in my web project that implements it and that is a wrapper around the real IUrlHelper.

I can use IActionResult in a standard class library for instance. It would be nice if this was possible with IUrlHelper too.

@rynowak
Copy link
Member

rynowak commented Mar 3, 2016

@strohhut - are you talking about moving it to Microsoft.AspNetCore.Mvc.Abstractions?

/cc @Eilon - I don't really see any reason why we couldn't do this.

@strohhut
Copy link
Author

strohhut commented Mar 3, 2016

@rynowak Yes that's what I'm talking about.

I just saw that UrlRouteContext and UrlActionContext which IUrlHelper uses are also not inside Microsoft.AspNetCore.Mvc.Abstractions so my wrapper workaround cannot be implemented that easily. Also this means moving only IUrlHelper into Microsoft.AspNetCore.Mvc.Abstractions won't work then I guess.

@rynowak
Copy link
Member

rynowak commented Mar 3, 2016

We would move all three types. Those two contexts are just parameter-objects they don't have any behavior.

@strohhut
Copy link
Author

strohhut commented Mar 3, 2016

Sounds great. It would make it a lot easier for helper libraries.

@Eilon Eilon added this to the 1.0.0-rc2 milestone Mar 3, 2016
@ajaybhargavb ajaybhargavb changed the title Possible to move IUrlHelper to an abstractions assembly? Move IUrlHelper to an abstractions assembly Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants