BottleServices() public method

public BottleServices ( ) : IEnumerable
return IEnumerable
コード例 #1
0
        public BottleServiceRunner Bootstrap(string bootstrapperType = null)
        {
            if (bootstrapperType.IsNotEmpty())
            {
                var type = Type.GetType(bootstrapperType);
                var bootstrapper = Activator.CreateInstance(type).As<IBootstrapper>();

                var wrapped = new WrappedBootstrapper(bootstrapper);
                PackageRegistry.LoadPackages(x => x.Bootstrapper(wrapped));

                PackageRegistry.AssertNoFailures();

                return new BottleServiceRunner(wrapped.BottleServices());
            }

            var facility = new BottlesServicePackageFacility();
            PackageRegistry.LoadPackages(x => x.Facility(facility));
            

            PackageRegistry.AssertNoFailures();

            return facility.Aggregator.ServiceRunner();
        }
コード例 #2
0
 public void Dispose()
 {
     _wrappedBootstrapper.BottleServices().Each(x => x.Stop());
 }