populateNutrientRecommendationImporter() 공개 메소드

public populateNutrientRecommendationImporter ( IComponentContext componentContext ) : void
componentContext IComponentContext
리턴 void
        public NutrientRecommendationImportEngine(string nhibernateConfiguration)
        {
            var builder = new ContainerBuilder();

            var componentRegistrator = new ComponentRegistrator();
            componentRegistrator.AutofacRegisterComponentes(builder, getBootStrapper(nhibernateConfiguration));
            containerProvider = new ContainerProvider(builder.Build());

            nutrientRecommendationImporter = containerProvider.ApplicationContainer.Resolve<INutrientRecommendationImporter>();
            initialDataValuesExporter = containerProvider.ApplicationContainer.Resolve<IInitialDataValuesExportEngine>();
            componentRegistrator.populateNutrientRecommendationImporter(containerProvider.ApplicationContainer);
        }
예제 #2
0
        private void AutofacRegisterComponentes()
        {
            var builder = new ContainerBuilder();

            builder.RegisterType<GraphLineOptionViewTypeConverter>().As<IGraphLineOptionViewTypeConverter>();
            builder.RegisterType<GenderViewTypeConverter>().As<IGenderViewTypeConverter>();
            builder.RegisterType<ActivityLevelViewTypeConverter>().As<IActivityLevelViewTypeConverter>();
            builder.RegisterType<RDIProxy>().As<IRDIProxy>();
            builder.RegisterModule(new TranslationModule());

            builder.RegisterControllers(Assembly.GetExecutingAssembly());
            builder.RegisterType<FormsAuthenticationService>().As<IFormsAuthenticationService>();
            builder.RegisterType<UserContext>().As<IUserContext>().HttpRequestScoped();
            var componentRegistrator = new ComponentRegistrator();
            componentRegistrator.AutofacRegisterComponentes(builder, getBootStrapper());

            containerProvider = new ContainerProvider(builder.Build());

            componentRegistrator.populateRDICalculatorFactory(containerProvider.ApplicationContainer);
            componentRegistrator.populateNutrientRecommendationImporter(containerProvider.ApplicationContainer);

            ControllerBuilder.Current.SetControllerFactory(new AutofacControllerFactory(ContainerProvider));
        }