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

Make the HostContext available to extension methods on IWebHostBuilder #1014

Closed
davidfowl opened this issue Apr 9, 2017 · 3 comments
Closed

Comments

@davidfowl
Copy link
Member

davidfowl commented Apr 9, 2017

Today it's impossible to get at the HostingContext as an extension method on IWebHostBuilder, this means you can't flow the IHostingEnvironment in your extension methods that hang off the builder.

/cc @JunTaoLuo @glennc

@glennc
Copy link
Member

glennc commented Apr 10, 2017

I was thinking of a couple of things around this:

  1. promote WebHostBuilderContext to abstractions and have it as a property of the builder
  2. provide a UseServices extension that has both WebHostBuilderContext and ServiceCollection. So that at least extensions that are just adding services can do it trivially.

What do you think of those?

@JunTaoLuo JunTaoLuo self-assigned this Apr 11, 2017
@JunTaoLuo JunTaoLuo added this to the 2.0.0 milestone Apr 11, 2017
@davidfowl
Copy link
Member Author

I don't think we need 2 types (maybe that was a typo?). UseServices shouldn't be required to get access to the host context, and it should be called ConfigureServices right?

@JunTaoLuo
Copy link
Contributor

Thanks @glennc for the PR #1020

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