diff --git a/src/contrib/dependencyinjection/Akka.DependencyInjection/IDependencyResolver.cs b/src/contrib/dependencyinjection/Akka.DependencyInjection/IDependencyResolver.cs index d221f6480db..ea0a63c51d9 100644 --- a/src/contrib/dependencyinjection/Akka.DependencyInjection/IDependencyResolver.cs +++ b/src/contrib/dependencyinjection/Akka.DependencyInjection/IDependencyResolver.cs @@ -20,7 +20,7 @@ namespace Akka.DependencyInjection public interface IDependencyResolver { IResolverScope CreateScope(); - object GetService(); + T GetService(); object GetService(Type type); /// diff --git a/src/contrib/dependencyinjection/Akka.DependencyInjection/ServiceProviderDependencyResolver.cs b/src/contrib/dependencyinjection/Akka.DependencyInjection/ServiceProviderDependencyResolver.cs index 8fdab7c3ada..68f10aff02b 100644 --- a/src/contrib/dependencyinjection/Akka.DependencyInjection/ServiceProviderDependencyResolver.cs +++ b/src/contrib/dependencyinjection/Akka.DependencyInjection/ServiceProviderDependencyResolver.cs @@ -30,7 +30,7 @@ public IResolverScope CreateScope() return new ServiceProviderScope(ServiceProvider.CreateScope()); } - public object GetService() + public T GetService() { return ServiceProvider.GetService(); }