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

Add extension method MapPath to HostingEnvironment #195

Closed
Praburaj opened this issue Mar 16, 2015 · 4 comments
Closed

Add extension method MapPath to HostingEnvironment #195

Praburaj opened this issue Mar 16, 2015 · 4 comments

Comments

@Praburaj
Copy link
Contributor

Add extension method: MapPath

Moving a part of #157 into a separate item.

@tyson-benson
Copy link

Hi @Praburaj Can I ask what kind of timeframe we've got for this extension? I got stuck on this when attempting to port an existing project to ASP.NET 5

@davidfowl
Copy link
Member

It's literally an extension method that does Path.Combine 😄

@tyson-benson
Copy link

That gave me a good chuckle, i figured it would be more complicated. Would it go something like this?

public static string MapPath(this IHostingEnvironment env, string relativePath)
{
    return System.IO.Path.Combine(env.WebRoot, relativePath);
}

@Praburaj
Copy link
Contributor Author

@tyson-benson @davidfowl I sent out a PR. I'll add some tests before checkin.

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

3 participants