public RegisterHostedService(IServiceCenter client, ServiceRegistration registration) { this.client = client; this.registration = registration; }
public static void AddServiceRegistry(this IServiceCollection services, ServiceRegistration registration, IServiceCenter client) { var reg = ServiceRegisterProvider.GetServices(registration); services.AddSingleton <IServiceCenter>(sp => client); services.AddSingleton <ServiceRegistration>(sp => registration); services.AddHostedService <RegisterHostedService>(); }