| | | 1 | | using Akka.DependencyInjection; |
| | | 2 | | using Akka.Actor; |
| | | 3 | | using Microsoft.Extensions.DependencyInjection; |
| | | 4 | | using SeungYongShim.Akka.DependencyInjection.Abstractions; |
| | | 5 | | |
| | | 6 | | |
| | | 7 | | namespace SeungYongShim.Akka.DependencyInjection |
| | | 8 | | { |
| | | 9 | | public static class ServiceProviderExtension |
| | | 10 | | { |
| | | 11 | | public static IPropsFactory<T> PropsFactory<T>(this ActorSystem actorSystem) where T : ActorBase => |
| | 10 | 12 | | DependencyResolver.For(actorSystem).Resolver.GetService<IPropsFactory<T>>(); |
| | | 13 | | |
| | | 14 | | public static IPropsFactory<T> PropsFactory<T>(this IUntypedActorContext context) where T : ActorBase => |
| | 6 | 15 | | DependencyResolver.For(context.System).Resolver.GetService<IPropsFactory<T>>(); |
| | | 16 | | } |
| | | 17 | | } |