예제 #1
0
 public ZaabyServer AddHostedService <THostedService>(ZaabyServer zaabyServer,
                                                      Func <IServiceProvider, THostedService> implementationFactory)
     where THostedService : class, IHostedService
 {
     TryAddEnumerable(ServiceDescriptor.Singleton <IHostedService>(implementationFactory));
     return(zaabyServer);
 }
예제 #2
0
        public static IZaabyServer GetInstance()
        {
            if (_zaabyServer == null)
            {
                lock (LockObj)
                {
                    if (_zaabyServer == null)
                    {
                        _zaabyServer = new ZaabyServer();
                    }
                }
            }

            return(_zaabyServer);
        }
예제 #3
0
 public static ZaabyServer UseZaabyClient(this ZaabyServer zaabyServer, Type serviceDefineType,
                                          Dictionary <string, List <string> > baseUrls) =>
 zaabyServer.ConfigureServices(services => { services.UseZaabyClient(serviceDefineType, baseUrls); });
예제 #4
0
 public ZaabyServer AddHostedService <THostedService>(ZaabyServer zaabyServer)
     where THostedService : class, IHostedService
 {
     TryAddEnumerable(ServiceDescriptor.Singleton <IHostedService, THostedService>());
     return(zaabyServer);
 }
예제 #5
0
 public static ZaabyServer FromAssemblyNames(this ZaabyServer server, params AssemblyName[] assemblyNames)
 {
     LoadHelper.FromAssemblyNames(assemblyNames);
     return(server);
 }
예제 #6
0
 public static ZaabyServer FromAssemblyOf <T>(this ZaabyServer server)
 {
     LoadHelper.FromAssemblyOf <T>();
     return(server);
 }
예제 #7
0
 public static ZaabyServer FromAssemblyOf(this ZaabyServer server, params Type[] types)
 {
     LoadHelper.FromAssemblyOf(types);
     return(server);
 }
예제 #8
0
 public static ZaabyServer FromAssemblyOf <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(this ZaabyServer server)
 {
     LoadHelper.FromAssemblyOf <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>();
     return(server);
 }