internal void SetParent(HostedServiceWrapper parent) { foreach (var hostedService in _hostedServices) { hostedService.Parent = parent; } }
internal HostedServiceWrapper Build(IServiceProvider sp) { var hostedServices = _activators .Select(a => a(sp)) .ToArray(); var sequentialHostedServices = new SequentialHostedServices(hostedServices); var logger = sp.GetRequiredService <ILogger <HostedServiceWrapper> >(); var wrapper = new HostedServiceWrapper(sequentialHostedServices, logger) { Name = _name }; sequentialHostedServices.SetParent(wrapper); return(wrapper); }