public AutofacRegisterComponentes ( |
||
builder | ||
bootStrapper | IBootStrapper | |
Résultat | 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); }
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)); }