Skip to content

Commit 738f478

Browse files
author
maximv
committed
using WithMicrosoftDependencyInjectionRules in MS.DI.DryIocAdapter
1 parent 5da3ca9 commit 738f478

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/DryIoc.Microsoft.DependencyInjection/DryIocAdapter.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,7 @@ public static IContainer WithDependencyInjectionAdapter(this IContainer containe
7272
Func<IRegistrator, ServiceDescriptor, bool> registerDescriptor = null)
7373
{
7474
if (container.Rules != Rules.MicrosoftDependencyInjectionRules)
75-
// todo: @check the better way to not duplicate the rules from MicrosoftDependencyInjectionRules
76-
container = container.With(rules => rules
77-
.With(FactoryMethod.ConstructorWithResolvableArguments)
78-
.WithFactorySelector(Rules.SelectLastRegisteredFactory())
79-
.WithTrackingDisposableTransients()
80-
.WithoutVariantGenericTypesInResolvedCollection());
75+
container = container.With(rules => rules.WithMicrosoftDependencyInjectionRules());
8176

8277
container.Use<IServiceScopeFactory>(r => new DryIocServiceScopeFactory(r));
8378

0 commit comments

Comments
 (0)