/// <summary>
        /// 添加服务运行时服务。
        /// </summary>
        /// <param name="builder">服务构建者。</param>
        /// <returns>服务构建者。</returns>
        public static IServiceBuilder AddServiceRuntime(this IServiceBuilder builder)
        {
            builder.Services.RegisterType(typeof(DefaultServiceEntryLocate)).As(typeof(IServiceEntryLocate)).SingleInstance();
            builder.Services.RegisterType(typeof(DefaultServiceExecutor)).As(typeof(IServiceExecutor))
            .Named <IServiceExecutor>(CommunicationProtocol.Tcp.ToString()).SingleInstance();

            return(builder.RegisterServices().RegisterRepositories().RegisterServiceBus().RegisterModules().AddRuntime());
        }
Exemple #2
0
 public static IServiceBuilder AddClient(this IServiceBuilder builder)
 {
     return(builder
            .RegisterServices()
            .RegisterRepositories()
            .RegisterServiceBus()
            .AddClientRuntime()
            .AddClientProxy());
 }
 /// <summary>
 /// 添加服务运行时服务。
 /// </summary>
 /// <param name="builder">服务构建者。</param>
 /// <returns>服务构建者。</returns>
 public static IServiceBuilder AddServiceRuntime(this IServiceBuilder builder)
 {
     builder.Services.RegisterType(typeof(DefaultServiceEntryLocate)).As(typeof(IServiceEntryLocate)).SingleInstance();
     if (AppConfig.ServerOptions.Protocol == CommunicationProtocol.Tcp)
     {
         builder.Services.RegisterType(typeof(DefaultServiceExecutor)).As(typeof(IServiceExecutor)).SingleInstance();
     }
     return(builder.RegisterServices().RegisterRepositories().RegisterServiceBus().RegisterModules().AddRuntime());
 }
Exemple #4
0
 /// <summary>
 /// 添加客户端属性注入
 /// </summary>
 /// <param name="builder">服务构建者</param>
 /// <returns>服务构建者</returns>
 public static IServiceBuilder AddClient(this IServiceBuilder builder)
 {
     return(builder
            .RegisterServices()
            .RegisterServiceBus()
            .RegisterModules()
            .RegisterInstanceByConstraint()
            .AddClientRuntime()
            .AddClientProxy());
 }
Exemple #5
0
 /// <summary>
 /// 添加服务运行时服务。
 /// </summary>
 /// <param name="builder">服务构建者。</param>
 /// <returns>服务构建者。</returns>
 public static IServiceBuilder AddServiceRuntime(this IServiceBuilder builder)
 {
     builder.Services.RegisterType(typeof(DefaultServiceEntryLocate)).As(typeof(IServiceEntryLocate)).SingleInstance();
     builder.Services.RegisterType(typeof(DefaultServiceExecutor)).As(typeof(IServiceExecutor)).SingleInstance();
     return(builder.RegisterServices().RegisterRepositories().RegisterServiceBus().AddRuntime());
 }