/// <summary> /// Adds Tubes services. /// </summary> public static void AddRPC(this IServiceCollection services) { services.AddSingleton <RPCServer>(); foreach (var type in Reflections.GetRPCManagerTypes()) { services.AddSingleton(type); } }
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); }