Automatically register open generic services into standard DI containers#108
Open
TonyTroeff wants to merge 6 commits intomainfrom
Open
Automatically register open generic services into standard DI containers#108TonyTroeff wants to merge 6 commits intomainfrom
TonyTroeff wants to merge 6 commits intomainfrom
Conversation
…tandard DI container.
…his is a potential breaking change)
…a supported type for named attribute parameters.
Introduced parameterized tests for generic service registrations to improve coverage and flexibility. Adjusted logic in `ServiceRegistrar` to handle open generic interfaces correctly by using their generic type definitions. Streamlined and simplified test data sources for better readability and maintainability.
Extended tests to include multi-generic services and adjusted attribute usage for them. Simplified interfaces and class definitions to use modern C# syntax. Updated project file to enable the latest language version.
TonyTroeff
commented
Mar 7, 2025
Member
Author
TonyTroeff
left a comment
There was a problem hiding this comment.
I had no comments after self-reviewing my PR.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Pull Request Description
This PR introduces enhancements primarily centered around enabling open generic service registration within the built-in dependency injection container.
This PR also changes the visibility of the
ServiceConfiguration.LifetimeIsSetmember to internal (it is not expected for this property to be used externally).Motivation and Context
The changes aim to enhance support for registering generic services as either open or closed generics, depending on what's necessary. This simplifies and expands the usability of the module for automatic registration of services, making it more flexible and capable of handling a wider variety of scenarios.
Checklist