-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Add support for instantiating the startup class #24144
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
Conversation
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Why is it still draft?
I need to add a test and do API review. |
So this adds new public UseStartup method overloads that take a factory to HostingStartupWebHostBuilder and WebHostBuilderExtensions? Anything else? Do we have a good way to create an API diff yet? |
That's the only new API. |
- Adds an overload of UseStartup that takes a factory so users can control the instance creation. The factory is given the WebHostBuilderContext to expose access to configuration and IWebHostEnvironment. - Make sure only one startup delegate runs, the last one registered.
8994e80
to
76846b0
Compare
Co-authored-by: Chris Ross <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API looks fine by me. Feel free to send an email for broader visibility.
- Use actual throw expressions... - Added null checks
Fixes #19809