Services() 공개 메소드

public Services ( ) : IEnumerable
리턴 IEnumerable
        public IDisposable Load()
        {
            var facility = new BottlesServicePackageFacility();

            PackageRegistry.LoadPackages(x => x.Facility(facility));
            PackageRegistry.AssertNoFailures();

            _services = facility.Services();
            if (!_services.Any())
            {
                throw new ApplicationException("No services were detected.  Shutting down.");
            }

            var tasks = _services.Select(x => x.ToTask()).ToArray();

            _services.Each(x => EventAggregator.Messaging.AddListener(x));

            tasks.Each(x => x.Start());

            Task.WaitAll(tasks);

            return this;
        }
예제 #2
0
        public IDisposable Load()
        {
            var facility = new BottlesServicePackageFacility();

            PackageRegistry.LoadPackages(x => x.Facility(facility));
            PackageRegistry.AssertNoFailures();

            _services = facility.Services();
            if (!_services.Any())
            {
                throw new ApplicationException("No services were detected.  Shutting down.");
            }

            var tasks = _services.Select(x => x.ToTask()).ToArray();

            _services.Each(x => EventAggregator.Messaging.AddListener(x));

            tasks.Each(x => x.Start());

            Task.WaitAll(tasks);

            return(this);
        }