Skip to content

Commit

Permalink
DryIoc 3 does not implement IServiceProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed May 23, 2019
1 parent 9cc2834 commit ebe35a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Prism.DryIoc.Extensions/PrismContainerExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public IContainerRegistry RegisterDelegate(Type serviceType, Func<IContainerProv

public IContainerRegistry RegisterDelegate(Type serviceType, Func<IServiceProvider, object> factoryMethod)
{
Instance.RegisterDelegate(serviceType, factoryMethod);
Instance.RegisterDelegate(serviceType, r => factoryMethod(r.Resolve<IServiceProvider>()));
return this;
}

Expand All @@ -194,10 +194,10 @@ public IContainerRegistry RegisterSingletonFromDelegate(Type serviceType, Func<I

public IContainerRegistry RegisterSingletonFromDelegate(Type serviceType, Func<IServiceProvider, object> factoryMethod)
{
Instance.RegisterDelegate(serviceType, r => factoryMethod(r), Reuse.Singleton);
Instance.RegisterDelegate(serviceType, r => factoryMethod(r.Resolve<IServiceProvider>()), Reuse.Singleton);
return this;
}

public object GetService(Type serviceType) => Instance.GetService(serviceType);
public object GetService(Type serviceType) => Instance.Resolve(serviceType);
}
}

0 comments on commit ebe35a0

Please sign in to comment.