-
Notifications
You must be signed in to change notification settings - Fork 203
Add back Get<T>() extension method to bind objects to configuration values or entire sections #532
Comments
This made it work: tugberkugurlu/AspNetCoreSamples@87cfde9 That's weird though. Is |
Here's the sample I've added to the config doc PR
|
thanks @Rick-Anderson! After getting help from Twitter people and digging into the source code, I discovered that It could have been better if it gave feedback about those situations rather than just returning |
Yep it's basically a convert. It's been a common source of confusion so far.
|
After discussion with @divega @glennc we've decided to bring back We'll need to hash out some of the specific details for some of the edge cases and the heuristics, but that discussion can go in the PR. |
Also this will eliminate the need for the |
@HaoK 🎉 🎉 thanks a lot! |
Associated PR for this work: #535 |
I am not sure where I am doing something wrong but I am seeing a weird behaviour in terms of getting parsing the JSON config file.
I would appreciate if someone can have a look and tell me where I am doing something stupid 😞
Repro Steps
git clone git@github.com:tugberkugurlu/AspNetCoreSamples.git cd AspNetCoreSamples/repros/ConfigSectionNull git checkout -qf 4101a06ab9ab05ac15ed2824a44ff97c323d371e dotnet restore dotnet run
Expected Result
Console output to be equal to below:
Actual Result
Console output is equal to below:
dotnet CLI Info
Source
Program.cs
:project.json
:config.json
:The text was updated successfully, but these errors were encountered: