-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
IOptions<T> should support C# records #46996
Comments
Feature request is already here: #43359 |
Tagging subscribers to this area: @maryamariyan Issue DetailsWith PR #2169 in place, there is no longer a compiler restriction on using records with We should be able to use fully-defaulted records with the IOptions pattern. The following builds but throws: record MyConfiguration(string value = "default");
MyConstructor(IOptions<MyConfiguration> configuration) { }
|
@christiannagel Ok, looks like this is on the radar. Thanks for pointing me to that existing feature request. |
Closing as dupe of #43359, thanks. |
With PR #2169 in place, there is no longer a compiler restriction on using records with
IOptions<T>
. However the default OptionsFactory implementation still requires a parameterless constructor.We should be able to use fully-defaulted records with the IOptions pattern. The following builds but throws:
The text was updated successfully, but these errors were encountered: