-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement service-injection mechanism for patch/point releases
Issue #7465 This change introduces a new class ServiceCollectionMap that is used by providers and by our service-adding methods. The new class builds a map from service type to indexes of the ServiceDescriptors in the list for the given type. This allows all the TryAdd calls that we make to work without scanning the list every time. In addition, this type has a method for re-writing services to do property injection when we need to add a service dependency without breaking a constructor in a patch or point release. This is used by making a call at the end of our service registrations like so: ```C# ... .TryAddScoped<IResultOperatorHandler, ResultOperatorHandler>() .DoPatchInjection<IValueGeneratorSelector>(); ``` Also, ReplaceService code has been updated to ensure that service-injection is also run on any replaced services, since these services may also inherit from our base classes.
- Loading branch information
1 parent
994500c
commit 4112c26
Showing
20 changed files
with
1,438 additions
and
280 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.