-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Open
Open
Copy link
Labels
area-Extensions-DependencyInjectiondocumentationDocumentation bug or enhancement, does not impact product or test codeDocumentation bug or enhancement, does not impact product or test code
Milestone
Description
Description
I heard feedback that folks felt the docs for AddSingleton lacked good information about when it would fail and why.
I took a look and I agree. It seems that whenever we have a method with a corresponding Try method, we should be sure to include the exception docs. That will help folks if they need to use the Try method always, or if they would prefer to just use the non-try method for simpler code and treat the exception case as an invalid configuration.
Reproduction Steps
Have a look at docs https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.servicecollectionserviceextensions.addsingleton?view=net-8.0
Expected behavior
Information about meaningful thrown exceptions exists.
Actual behavior
No information exists
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
area-Extensions-DependencyInjectiondocumentationDocumentation bug or enhancement, does not impact product or test codeDocumentation bug or enhancement, does not impact product or test code