Exemplo n.º 1
0
 /// <summary>
 /// Adds Tubes services.
 /// </summary>
 public static void AddRPC(this IServiceCollection services)
 {
     services.AddSingleton <RPCServer>();
     foreach (var type in Reflections.GetRPCManagerTypes())
     {
         services.AddSingleton(type);
     }
 }
Exemplo n.º 2
0
 public RPCServer(
     ILogger <RPCServer> logger,
     IServiceProvider services,
     IControllerFactory factory,
     IAuthorizationService authorization)
 {
     _logger        = logger;
     _services      = services;
     _factory       = factory;
     _authorization = authorization;
     _managers      =
         Reflections.GetRPCManagerTypes()
         .Select(x => (IRPCManager)_services.GetService(x))
         .ToImmutableDictionary(x => x.Name, x => x);
 }