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

Added the ConfigureDefaults API, as an extension method of IHostBuilder #50447

Merged
merged 3 commits into from
Mar 31, 2021

Conversation

IEvangelist
Copy link
Member

@IEvangelist IEvangelist commented Mar 30, 2021

Added the ConfigureDefaults API, as an extension method on the IHostBuilder interface.

  • Add corresponding ref entry
  • Encapsulate logic from CreateDefaultBuilder(string[] args) into ConfigureDefaults
  • The CreateDefaultBuilder(string[] args) method now calls ConfigureDefaults
  • The ConfigureDefaults method had a bit of its conditional checks simplified with C# 9 pattern matching
  • Remove unused using statements in Host
  • Update <summary> tags accordingly
  • Added unit test to verify a default config value is applied

Fixes #36003

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@ghost
Copy link

ghost commented Mar 30, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

Added the ConfigureDefaults API, as an extension method on the IHostBuilder interface.

  • Add corresponding ref entry
  • Encapsulate logic from CreateDefaultBuilder(string[] args) into ConfigureDefaults
  • The CreateDefaultBuilder(string[] args) method now calls ConfigureDefaults
  • Added unit test to verify a default config value is applied

Fixes #36003

Author: IEvangelist
Assignees: -
Labels:

area-Extensions-Hosting, new-api-needs-documentation

Milestone: -

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Just a few minor comments.

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks again for the contribution here!

@davidfowl davidfowl added this to the 6.0.0 milestone Mar 30, 2021
@maryamariyan maryamariyan merged commit 082af35 into dotnet:main Mar 31, 2021
@maryamariyan
Copy link
Member

Test failure logged in #48696

@IEvangelist IEvangelist deleted the add-configuredefaults-api branch March 31, 2021 11:51
@ghost ghost locked as resolved and limited conversation to collaborators Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API Proposal: Expose Host.ConfigureDefaults
4 participants