コード例 #1
0
ファイル: BuilderExtensions.cs プロジェクト: JesseCaple/mRPC
 /// <summary>
 /// Adds Tubes services.
 /// </summary>
 public static void AddRPC(this IServiceCollection services)
 {
     services.AddSingleton <RPCServer>();
     foreach (var type in Reflections.GetRPCManagerTypes())
     {
         services.AddSingleton(type);
     }
 }
コード例 #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);
 }