You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

enumeration.cs 415 B

123456789101112131415161718
  1. public class ServiceActivator
  2. {
  3. // This contains *all* registered services of serviceType IService
  4. private readonly IEnumerable<IService> _services;
  5. public ServiceActivator(IEnumerable<IService> services)
  6. {
  7. _services = services;
  8. }
  9. public async Task ActivateAsync()
  10. {
  11. foreach(var service in _services)
  12. {
  13. await service.StartAsync();
  14. }
  15. }
  16. }