Skip to content

Commit

Permalink
- cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Tolstikov authored and khellang committed Jan 28, 2022
1 parent 39a690a commit 7e4f04d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/Scrutor/ServiceCollectionExtensions.Decoration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private static object GetInstance(this IServiceProvider provider, ServiceDescrip
if (implementationType != null)
{
if (implementationType != descriptor.ServiceType)
return provider.GetServiceOrCreateInstance(descriptor.ImplementationType);
return provider.GetServiceOrCreateInstance(implementationType);

// Since implementationType is equal to ServiceType we need explicitly create an implementation type through reflections in order to avoid infinite recursion.
// Should not cause issue with singletons, since singleton will be a decorator and after this fact we can don't care about lifecycle of decorable service (for sure, if IDisposable of decorator disposes underlying type:))
Expand Down
1 change: 0 additions & 1 deletion test/Scrutor.Tests/DecorationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Microsoft.Extensions.DependencyInjection;
using Xunit;
using System.Linq;
using static Scrutor.Tests.DecorationTests;

namespace Scrutor.Tests
{
Expand Down

0 comments on commit 7e4f04d

Please sign in to comment.