You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 7, 2018. It is now read-only.
Add support for binding property to IConfiguration #60
If you have only one level of nesting like in your example, Dictionary<string, string> will work. If you have multiple levels (e.g. VisualStudioVersion being a complex object), we don't support it that today and you have to use IConfiguration.
It definitely seems to support Dictionary<string, string> though I'm not sure if TValue can be a simple type such as int, though I do see it can also be a complex type.
Activity
Eilon commentedon May 1, 2015
This is like a combination of model binding and tag helpers 😄
We do support binding to dictionaries now with @victorhurdugaci 's change, no? Would that work here?
davidfowl commentedon May 1, 2015
If I have a complex structure this gives me more flexibility
Eilon commentedon May 1, 2015
True, but in the specific case you gave I think it's supported quite well. So, backlog?
davidfowl commentedon May 1, 2015
Sure
davidfowl commentedon May 1, 2015
Would it be
Dictionary<string, string>?victorhurdugaci commentedon May 1, 2015
If you have only one level of nesting like in your example,
Dictionary<string, string>will work. If you have multiple levels (e.g.VisualStudioVersionbeing a complex object), we don't support it that today and you have to useIConfiguration.Eilon commentedon May 1, 2015
I think it does all kinds of conversions for you... https://github.com/aspnet/Options/blob/dev/test/Microsoft.Framework.OptionsModel.Test/ConfigurationCollectionBindingTests.cs
It definitely seems to support
Dictionary<string, string>though I'm not sure ifTValuecan be a simple type such asint, though I do see it can also be a complex type.victorhurdugaci commentedon May 1, 2015
Dictionary<string, T>is supported as long as all Ts are the same type.Tcan beint.Eilon commentedon May 1, 2015
Ah don't think I saw a test for that... did I miss it? If it's not there, can we quickly add one?
victorhurdugaci commentedon May 1, 2015
Sure, I can add one tomorrow
victorhurdugaci commentedon May 6, 2015
So, is this backlog or not?
Eilon commentedon May 7, 2015
@davidfowl how passionate are you about this? For me this seems like super backlog. We can bring this back at any time.
HaoK commentedon Sep 30, 2015
Config binder has moved to config and there's a similar bug here: aspnet/Configuration#274