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

            return(_zaabyServer);
        }
Exemple #3
0
 public static ZaabyServer UseZaabyClient(this ZaabyServer zaabyServer, Type serviceDefineType,
                                          Dictionary <string, List <string> > baseUrls) =>
 zaabyServer.ConfigureServices(services => { services.UseZaabyClient(serviceDefineType, baseUrls); });
Exemple #4
0
 public ZaabyServer AddHostedService <THostedService>(ZaabyServer zaabyServer)
     where THostedService : class, IHostedService
 {
     TryAddEnumerable(ServiceDescriptor.Singleton <IHostedService, THostedService>());
     return(zaabyServer);
 }
Exemple #5
0
 public static ZaabyServer FromAssemblyNames(this ZaabyServer server, params AssemblyName[] assemblyNames)
 {
     LoadHelper.FromAssemblyNames(assemblyNames);
     return(server);
 }
Exemple #6
0
 public static ZaabyServer FromAssemblyOf <T>(this ZaabyServer server)
 {
     LoadHelper.FromAssemblyOf <T>();
     return(server);
 }
Exemple #7
0
 public static ZaabyServer FromAssemblyOf(this ZaabyServer server, params Type[] types)
 {
     LoadHelper.FromAssemblyOf(types);
     return(server);
 }
Exemple #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);
 }