/// <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()); }
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()); }
/// <summary> /// 添加客户端属性注入 /// </summary> /// <param name="builder">服务构建者</param> /// <returns>服务构建者</returns> public static IServiceBuilder AddClient(this IServiceBuilder builder) { return(builder .RegisterServices() .RegisterServiceBus() .RegisterModules() .RegisterInstanceByConstraint() .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(); builder.Services.RegisterType(typeof(DefaultServiceExecutor)).As(typeof(IServiceExecutor)).SingleInstance(); return(builder.RegisterServices().RegisterRepositories().RegisterServiceBus().AddRuntime()); }