Bottles.Services.BottlesServicePackageFacility.Services C# (CSharp) Method

Services() public method

public Services ( ) : IEnumerable
return IEnumerable
        public IEnumerable<IBottleService> Services()
        {
            return _bootstrapper.Services();
        }

Usage Example

        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;
        }
All Usage Examples Of Bottles.Services.BottlesServicePackageFacility::Services