Skip to content

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

Merged
maryamariyan merged 3 commits into
dotnet:mainfrom
IEvangelist:add-configuredefaults-api
Mar 31, 2021
Merged

maryamariyan merged 3 commits into
dotnet:mainfrom
IEvangelist:add-configuredefaults-api

Conversation

@IEvangelist

@IEvangelist IEvangelist commented Mar 30, 2021 •

Copy link
Copy Markdown
Member

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

@ghost

ghost commented Mar 30, 2021

Copy link
Copy Markdown

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

ghost commented Mar 30, 2021

Copy link
Copy Markdown

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: -

@eerhardt eerhardt left a comment

Copy link
Copy Markdown
Member

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.

@eerhardt eerhardt left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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