-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
IConfiguration append additional property #56301
Comments
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsSide note related to same problem in different area of the stack: Even if this solves the problem for Originally posted by @dazinator in #56297 (comment)
|
System.Text.Json
, I have the same problem for Microsoft.Extensions.Options
when binding an options class with a polymorphic list, to an IConfiguration
section. In this case the a json file is first read by ConfigurationBuilder.AddJsonFile("appsettings.json")
and ends up as essentially key value pairs. The descriminator property is now a key value pair in the IConfiguration. When materialising IOptions
from this IConfiguration, there is now no JSON converter involved, so if I want to handle polymorphic lists I have to implement a seperate solution here, and it seems like there isn't a way to take control of binding yet.
Tagging subscribers to this area: @maryamariyan Issue DetailsSide note related to same problem in different area of the stack: Even if this solves the problem for Originally posted by @dazinator in #56297 (comment)
|
@dazinator I've forked your comment into a separate issue for easier review. |
Looks like you've already filed a second issue in #56302. Closing in favor of that one. |
Side note related to same problem in different area of the stack: Even if this solves the problem for
System.Text.Json
, I have the same problem forMicrosoft.Extensions.Options
when binding an options class with a polymorphic list, to anIConfiguration
section. In this case the a json file is first read byConfigurationBuilder.AddJsonFile("appsettings.json")
and ends up as essentially key value pairs. The descriminator property is now a key value pair in the IConfiguration. When materialisingIOptions
from this IConfiguration, there is now no JSON converter involved, so if I want to handle polymorphic lists I have to implement a seperate solution here, and it seems like there isn't a way to take control of binding yet.Originally posted by @dazinator in #56297 (comment)
The text was updated successfully, but these errors were encountered: