-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Remove indirection in DependencyInjection #52140
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c570ed7
Remove indirection
pakrym d1e4a72
Merge branch 'main' into pakrym/Remove-indirection
pakrym 5691bf0
Get rid of scope state and lock on ResolvedServices
pakrym c5c9245
Don't run customer code under the lock
pakrym 4ec81bf
No public API changes
pakrym d67f186
Accessor
pakrym e0f9782
Merge remote-tracking branch 'dotnet/main' into pakrym/Remove-indirec…
pakrym d052b0a
merge
pakrym File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
28 changes: 0 additions & 28 deletions
28
src/libraries/Microsoft.Extensions.DependencyInjection/src/ScopeState.cs
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,23 +2,21 @@ | |
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace Microsoft.Extensions.DependencyInjection.ServiceLookup | ||
| { | ||
| internal sealed class ExpressionsServiceProviderEngine : ServiceProviderEngine | ||
| { | ||
| private readonly ExpressionResolverBuilder _expressionResolverBuilder; | ||
| public ExpressionsServiceProviderEngine(IEnumerable<ServiceDescriptor> serviceDescriptors) : base(serviceDescriptors) | ||
|
|
||
| public ExpressionsServiceProviderEngine(ServiceProvider serviceProvider) | ||
| { | ||
| _expressionResolverBuilder = new ExpressionResolverBuilder(RuntimeResolver, this, Root); | ||
| _expressionResolverBuilder = new ExpressionResolverBuilder(serviceProvider); | ||
| } | ||
|
|
||
| protected override Func<ServiceProviderEngineScope, object> RealizeService(ServiceCallSite callSite) | ||
| public override Func<ServiceProviderEngineScope, object> RealizeService(ServiceCallSite callSite) | ||
| { | ||
| Func<ServiceProviderEngineScope, object> realizedService = _expressionResolverBuilder.Build(callSite); | ||
| RealizedServices[callSite.ServiceType] = realizedService; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These calls were redundant. |
||
| return realizedService; | ||
| return _expressionResolverBuilder.Build(callSite); | ||
| } | ||
| } | ||
| } | ||
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
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
14 changes: 0 additions & 14 deletions
14
...ries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/IServiceProviderEngine.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.