Example #1
0
        public static IContainer InitializeContainer(InitializeOptions options, ContainerBuilder builder)
        {
            if (!(options.AssembliesToScan == null || options.AssembliesToScan.Length <= 0))
            {
                builder.RegisterAssemblyModules(options.AssembliesToScan);
            }

            if (!(options.Modules == null || options.Modules.Length <= 0))
            {
                foreach (var module in options.Modules)
                {
                    builder.RegisterModule(module);
                }
            }

            return(builder.Build(options.BuildOptions));
        }