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

Replace IHostingEnvironment with IWebHostEnvironment #7725

Merged
merged 2 commits into from
Feb 20, 2019
Merged

Conversation

Tratcher
Copy link
Member

@Tratcher Tratcher commented Feb 19, 2019

This is the second half of dotnet/extensions#966

IHostingEnvironment is replaced by IWebHostEnvironment
IApplicationEnvironment is replaced by Extensions.Hosting.IHostApplicationEnvironment

Due to the size and timing of this PR nits in samples or tests are unlikely to be addressed.

Also, there are quite a few public constructors that were modified. These are primarily invoked by DI and there is little end-user impact. I'm not keeping the old constructors as the old types are not convertible to the new types. Removing the old constructors seems preferable to obsoleting them with an error.

@JunTaoLuo
Copy link
Contributor

:shipit: When tests pass.

@@ -9,7 +9,62 @@ namespace Microsoft.AspNetCore.Hosting.Internal
{
public static class HostingEnvironmentExtensions
{
#pragma warning disable CS0618 // Type or member is obsolete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno why this was made public in the first place.

@Tratcher Tratcher merged commit 4e44025 into master Feb 20, 2019
@Tratcher Tratcher deleted the tratcher/hosting branch February 20, 2019 05:11
@tebeco
Copy link
Contributor

tebeco commented Feb 20, 2019

dumb question but why not align interface name ?
IXxxHostEnvironment or IHostYyyEnvironment

when people are going to find IHostApplicationEnvironment it will probably NOT be straightforward to think that you actually have to backspace back to I to re-type Web

that’s a really naive question there are probably tons of better reason than doing
IWebHostEnvironment
IApplicationHostEnvironment

or
IHostWebEnvironnent
IHostApplicationEnvironment

@Tratcher
Copy link
Member Author

The new types are:
IHostEnvironment
IWebHostEnvironment
IHostApplicationLifetime

IHostWebEnvironment doesn't convey any more meaning.

IApplicationHostLifetime sounds slightly better than IHostApplicationLifetime. @davidfowl @glennc?

@Tratcher
Copy link
Member Author

Announcement posted. #7749

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

Successfully merging this pull request may close these issues.

6 participants