Esempio n. 1
0
        /// <summary>
        /// Uses the StructureMap container built by the specified lambda as the application container. Use this overload if the StructureMap registration
        /// depends on the Bottle scanning (PackageRegistry.PackageAssemblies).
        /// </summary>
        /// <param name="expression"></param>
        /// <param name="createContainer"></param>
        /// <returns></returns>
        public static FubuApplication StructureMap(this IContainerFacilityExpression expression, Func <IContainer> createContainer)
        {
            return(expression.ContainerFacility(() =>
            {
                var container = createContainer();

                return new StructureMapContainerFacility(container);
            }));
        }
 public static FubuApplication Autofac(this IContainerFacilityExpression expression, Func<IComponentContext> createContext)
 {
     return expression.ContainerFacility(
         () =>
         {
             IComponentContext context = createContext();
             return new AutofacContainerFacility(context);
         });
 }
        public static FubuApplication StructureMap(this IContainerFacilityExpression expression, Func <IContainer> createContainer)
        {
            return(expression.ContainerFacility(() =>
            {
                var container = createContainer();

                // TODO -- why is this necessary at all?
                ServiceLocator.SetLocatorProvider(() => new StructureMapServiceLocator(ObjectFactory.Container));

                return new StructureMapContainerFacility(container);
            }));
        }
Esempio n. 4
0
 public static FubuApplication Windsor(this IContainerFacilityExpression expression, IWindsorContainer container)
 {
     return(expression.ContainerFacility(new WindsorContainerFacility(container)));
 }