Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't bind IDictionary #442
Properties which directly expose
referenced this issue
Jun 4, 2016
Is there any chance that a similar change could be made to support ICollection?
For instance, OpenIdConnectOptions has an ICollection for its "Scope" property. I've worked around this by adding a "Scopes" string with space seperator, getting the string value, and splitting into a list in code. But automatic binding to a list would be preferable.
EDIT: I just realized that there is no setter for that property... So probably not a good example of the issue. You would have to clear, then add all the properties from the JSON.
@adamholdenyall the proposed pull request #453 would actually deal with this situation too. Previously, the binder would not find directly exposed
When a property is an interface, it must already be initialised in order to be bound (the configuration binder wouldn't know which concrete class to assign to an interface property), so the lack of a setter is not a problem.
WRT OpenIdConnectOptions, the proposed fix would allow that to be bound as you hope.
Is there any reason why the binder couldn't create a