public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { builder.RegisterType<ShippingByWeightService>().As<IShippingByWeightService>().InstancePerHttpRequest(); //data layer var dataSettingsManager = new DataSettingsManager(); var dataProviderSettings = dataSettingsManager.LoadSettings(); if (dataProviderSettings != null && dataProviderSettings.IsValid()) { //register named context builder.Register<IDbContext>(c => new ShippingByWeightObjectContext(dataProviderSettings.DataConnectionString)) .Named<IDbContext>("nop_object_context_shipping_weight_zip") .InstancePerHttpRequest(); builder.Register<ShippingByWeightObjectContext>(c => new ShippingByWeightObjectContext(dataProviderSettings.DataConnectionString)) .InstancePerHttpRequest(); } else { //register named context builder.Register<IDbContext>(c => new ShippingByWeightObjectContext(c.Resolve<DataSettings>().DataConnectionString)) .Named<IDbContext>("nop_object_context_shipping_weight_zip") .InstancePerHttpRequest(); builder.Register<ShippingByWeightObjectContext>(c => new ShippingByWeightObjectContext(c.Resolve<DataSettings>().DataConnectionString)) .InstancePerHttpRequest(); } //override required repository with our custom context builder.RegisterType<EfRepository<ShippingByWeightRecord>>() .As<IRepository<ShippingByWeightRecord>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_shipping_weight_zip")) .InstancePerHttpRequest(); }
public void Register(IContainerManager containerManager, ITypeFinder typeFinder) { // var cacheProvider = new UserProvider(containerManager.Resolve<IUserProvider>()); containerManager.AddComponentInstance(typeof(IUserProvider), cacheProvider); containerManager.AddComponentInstance(typeof(IProvider<User>), cacheProvider); }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { //controllers builder.RegisterControllers(typeFinder.GetAssemblies().ToArray()); //data access var dataSettingsManager = new DataSettingsManager(); var dataProviderSettings = dataSettingsManager.LoadSettings(); //todo:暂时把连接字符串写死,测试时使用 //dataProviderSettings.DataConnectionString = @"Data Source=(localdb)\ProjectsV12;Initial Catalog=FzrainFramework;attachdbfilename=E:\MyFramework\Fzrain.Framework\Fzrain.Web\App_Data\FzrainFramework.mdf;Integrated Security=True;Persist Security Info=False;"; //dataProviderSettings.DataProvider = "sqlserver"; builder.Register(c => dataProviderSettings).As<DataSettings>(); builder.Register(x => new EfDataProviderManager(x.Resolve<DataSettings>())).As<BaseDataProviderManager>().InstancePerDependency(); builder.Register(x => x.Resolve<BaseDataProviderManager>().LoadDataProvider()).As<IDataProvider>().InstancePerDependency(); if (dataProviderSettings != null && dataProviderSettings.IsValid()) { var efDataProviderManager = new EfDataProviderManager(dataProviderSettings); var dataProvider = efDataProviderManager.LoadDataProvider(); dataProvider.InitConnectionFactory(); builder.Register<IDbContext>(c => new FzrainContext(dataProviderSettings.DataConnectionString)).InstancePerLifetimeScope(); } else { builder.Register<IDbContext>(c => new FzrainContext(dataSettingsManager.LoadSettings().DataConnectionString)).InstancePerLifetimeScope(); } //repository builder.RegisterGeneric(typeof(EfRepository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope(); //service builder.RegisterType<UserService>().As<IUserService>().InstancePerLifetimeScope(); builder.RegisterType<LolService>().As<ILolService>().InstancePerLifetimeScope(); builder.RegisterType<SettingService>().As<ISettingService>().InstancePerLifetimeScope(); }
public ControllerMapper(ITypeFinder typeFinder, IDefinitionManager definitionManager) { IList<ControlsAttribute> controllerDefinitions = FindControllers(typeFinder); foreach (ItemDefinition id in definitionManager.GetDefinitions()) { IAdapterDescriptor controllerDefinition = GetControllerFor(id, controllerDefinitions); if(controllerDefinition != null) { ControllerMap[id.ItemType] = controllerDefinition.ControllerName; // interacting with static context is tricky, here I made the assumtion that the last // finder is the most relevat and takes the place of previous ones, this makes a few // tests pass and doesn't seem to be called in production foreach (var finder in PathDictionary.GetFinders(id.ItemType).Where(f => f is ActionResolver)) PathDictionary.RemoveFinder(id.ItemType, finder); // Use MVC's ReflectedControllerDescriptor to find all actions on the Controller var methods = new ReflectedControllerDescriptor(controllerDefinition.AdapterType) .GetCanonicalActions() .Select(m => m.ActionName).ToArray(); var actionResolver = new ActionResolver(this, methods); _controllerActionMap[controllerDefinition.ControllerName] = methods; PathDictionary.PrependFinder(id.ItemType, actionResolver); } } }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, bool isActiveModule) { if (isActiveModule) { builder.RegisterType<PayPalExpressCheckoutFilter>().AsActionFilterFor<CheckoutController>(x => x.PaymentMethod()).InstancePerRequest(); } }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { builder.RegisterType<MovieService>().As<IMovieService>().InstancePerLifetimeScope(); builder.RegisterControllers(typeFinder.GetAssemblies().ToArray()); string conn = "Data Source=.;Initial Catalog=Axxe;Trusted_Connection=False;"; builder.RegisterGeneric(typeof(EfRepository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope(); var dataSettingsManager = new DataSettingsManager(); var dataProviderSettings = dataSettingsManager.LoadSettings(); builder.Register(c => dataSettingsManager.LoadSettings()).As<DataSettings>(); builder.Register<IDbContext>(c => new NopObjectContext(conn)).InstancePerLifetimeScope(); builder.Register(x => new EfDataProviderManager(x.Resolve<DataSettings>())).As<BaseDataProviderManager>().InstancePerDependency(); var efDataProviderManager = new EfDataProviderManager(dataSettingsManager.LoadSettings()); var dataProvider = efDataProviderManager.LoadDataProvider(); dataProvider.InitConnectionFactory(); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { //webworkcontenxt 上下文注入 builder.RegisterType<WebWorkContext>().As<IWorkContext>().InstancePerLifetimeScope(); //bll 注入 builder.RegisterType<CustomerService>().As<ICustomersService>().InstancePerLifetimeScope(); //用户身份认证 builder.RegisterType<AuthenticationService>().As<IAuthenticationService>().InstancePerHttpRequest(); //验证码管理器 builder.RegisterType<DefaultCaptchaManager>().As<ICaptchaManager>().SingleInstance(); //缓存注册 //builder.Register(c => new DefaultCacheService(new RuntimeMemoryCache(), 1.0f)) // .As<ICacheService>() // .SingleInstance(); //cachemanager注入 //系统日志注入 builder.RegisterType<Log4NetLoggerFactoryAdapter>().As<ILoggerFactoryAdapter>().SingleInstance(); builder.RegisterType<CacheManagerFactoryAdapter>().As<ICacheManagerFactoryAdapter>().SingleInstance(); //所有的controllers 注入 builder.RegisterControllers(typeFinder.GetAssemblies().ToArray()); //数据层注入 var configstrategy = new ConfigStrategy(); var RDBSConfigInfo = configstrategy.GetRDBSConfigInfo(); builder.Register<IDbContext>( c => new ShepherdsFrameworkDbContext(RDBSConfigInfo.RDBSConnectionString)) .InstancePerLifetimeScope(); //泛型注入 builder.RegisterGeneric(typeof(EFRepository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope(); }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { //HTTP context and other related stuff builder.Register(c => //register FakeHttpContext when HttpContext is not available HttpContext.Current != null ? (new HttpContextWrapper(HttpContext.Current) as HttpContextBase) : (new FakeHttpContext("~/") as HttpContextBase)) .As<HttpContextBase>() .InstancePerHttpRequest(); builder.Register(c => c.Resolve<HttpContextBase>().Request) .As<HttpRequestBase>() .InstancePerHttpRequest(); builder.Register(c => c.Resolve<HttpContextBase>().Response) .As<HttpResponseBase>() .InstancePerHttpRequest(); builder.Register(c => c.Resolve<HttpContextBase>().Server) .As<HttpServerUtilityBase>() .InstancePerHttpRequest(); builder.Register(c => c.Resolve<HttpContextBase>().Session) .As<HttpSessionStateBase>() .InstancePerHttpRequest(); builder.RegisterType<SqlServerProvider>().As<IDbProvider>(); builder.RegisterType<MemoryProvider>().Named<ICache>("memory"); var list = typeFinder.FindClassesOfType<ICache>().ToList(); list.ForEach(s=>builder.RegisterType(s)); //list.ForEach(s=>builder.RegisterType<s>()); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { Singleton<IDependencyResolver>.Instance = new DependencyResolver(); string collectionString = "Data Source=.;Initial Catalog=demo;User ID=sa;Password=sa;Trusted_Connection=False;"; builder.Register<IDbContext>(c => new WaterMoonContext(collectionString)).PerLifeStyle(ComponentLifeStyle.LifetimeScope); builder.RegisterGeneric(typeof(EfRepository<>)).As(typeof(IRepository<>)).PerLifeStyle(ComponentLifeStyle.LifetimeScope); builder.RegisterGeneric(typeof(PagedList<>)).As(typeof(IPagedList<>)).PerLifeStyle(ComponentLifeStyle.LifetimeScope); builder.RegisterType<DefualtMapping>().As<IMapping>().SingleInstance(); //注册所有实现IConsumer<>类型的对象 var consumers = typeFinder.FindClassesOfType(typeof(IConsumer<>)).ToList(); foreach (var consumer in consumers) { builder.RegisterType(consumer) .As(consumer.FindInterfaces((type, criteria) => { var isMatch = type.IsGenericType && ((Type)criteria).IsAssignableFrom(type.GetGenericTypeDefinition()); return isMatch; }, typeof(IConsumer<>))) .PerLifeStyle(ComponentLifeStyle.LifetimeScope); } builder.RegisterType<EventPublisher>().As<IEventPublisher>().SingleInstance(); builder.RegisterType<SubscriptionService>().As<ISubscriptionService>().SingleInstance(); builder.RegisterType<DemoService>().As<IDemoService>().PerLifeStyle(ComponentLifeStyle.LifetimeScope); }
public void Register(IContainerManager containerManager, ITypeFinder typeFinder) { containerManager.AddComponentInstance<IRepositoryProvider>(new RepositoryProvider(containerManager.Resolve<IRepositoryProvider>())); containerManager.AddComponent<IMediaFolderProvider, MediaFolderProvider>(); containerManager.AddComponent<IMediaContentProvider, MediaContentProvider>(); containerManager.AddComponent<ITextContentFileProvider, TextContentFileProvider>(); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { builder.RegisterType<WebWorkContext>().As<IWorkContext>().InstancePerLifetimeScope(); builder.RegisterType<CustomerService>().As<ICustomersService>().InstancePerLifetimeScope(); //所有的controllers 注入 }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { builder.RegisterType<SqlServerDataProvider>().As<BaseDataProvider>().InstancePerDependency(); builder.Register(x => new EfDataProviderManager()).As<BaseDataProviderManager>().InstancePerDependency(); var dataProviderManager = new EfDataProviderManager(); var dataSettings = dataProviderManager.DataSettings; Guard.MustFollow(() => dataSettings.NotNull() && dataSettings.IsValid(), () => { throw new Saturn72Exception("Failed to read DataSettings."); }); var dataProvider = dataProviderManager.DataProvider; Guard.NotNull(dataProvider); dataProvider.SetDatabaseInitializer(); var nameOrConnectionString = dataSettings.DataConnectionString.HasValue() ? dataSettings.DataConnectionString : dataSettings.DatabaseName; builder.Register<IDbContext>(c => new Saturn72ObjectContext(nameOrConnectionString)) .InstancePerLifetimeScope(); builder.RegisterGeneric(typeof (EfRepository<>)).As(typeof (IRepository<>)).InstancePerLifetimeScope(); }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { builder.RegisterControllers(typeFinder.GetAssemblies().ToArray()); builder.Register<IDbContext>(c => new MmDataContext(ConfigurationManager.ConnectionStrings["MmDataContext"].ConnectionString)).InstancePerHttpRequest(); builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)).InstancePerHttpRequest(); builder.Register(c => new HttpContextWrapper(HttpContext.Current) as HttpContextBase) .As<HttpContextBase>() .InstancePerHttpRequest(); builder.Register(c => c.Resolve<HttpContextBase>().Request) .As<HttpRequestBase>() .InstancePerHttpRequest(); builder.Register(c => c.Resolve<HttpContextBase>().Response) .As<HttpResponseBase>() .InstancePerHttpRequest(); builder.Register(c => c.Resolve<HttpContextBase>().Server) .As<HttpServerUtilityBase>() .InstancePerHttpRequest(); builder.Register(c => c.Resolve<HttpContextBase>().Session) .As<HttpSessionStateBase>() .InstancePerHttpRequest(); //services builder.RegisterType<FormAuthenticationService>().As<IAuthenticationService>().InstancePerHttpRequest(); builder.RegisterType<UserService>().As<IUserService>().InstancePerHttpRequest(); builder.RegisterType<EmailSender>().As<IEmailSender>().InstancePerHttpRequest(); builder.RegisterType<ArticleService>().As<IArticleService>().InstancePerHttpRequest(); builder.RegisterType<FormatService>().As<IFormatService>().InstancePerHttpRequest(); builder.RegisterType<MaterialService>().As<IMaterialService>().InstancePerHttpRequest(); builder.RegisterType<TagService>().As<ITagService>().InstancePerHttpRequest(); builder.RegisterType<ThingService>().As<IThingService>().InstancePerHttpRequest(); builder.RegisterType<StateService>().As<IStateService>().InstancePerHttpRequest(); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, bool isActiveModule) { if (DataSettings.DatabaseIsInstalled()) { builder.RegisterType<PreviewModeFilter>().AsResultFilterFor<PublicControllerBase>(); } }
public ControllerMapper(ITypeFinder typeFinder, IContentTypeManager definitionManager, IKernel kernel) { IList<ControlsAttribute> controllerDefinitions = FindControllers(typeFinder); foreach (ContentType id in definitionManager.GetContentTypes()) { IAdapterDescriptor controllerDefinition = GetControllerFor(id.ItemType, controllerDefinitions); if (controllerDefinition != null) { string controllerName = GetControllerName(controllerDefinition.AdapterType, controllerDefinition.AreaName); ControllerMap[id.ItemType] = controllerDefinition.ControllerName; AreaMap[id.ItemType] = controllerDefinition.AreaName; if (!kernel.GetBindings(typeof(IController)).Any(b => b.Metadata.Name == controllerName)) kernel.Bind<IController>().To(controllerDefinition.AdapterType) .InTransientScope() .Named(controllerName); IList<IPathFinder> finders = PathDictionary.GetFinders(id.ItemType); if (0 == finders.Where(f => f is ActionResolver).Count()) { // TODO: Get the list of methods from a list of actions retrieved from somewhere within MVC var methods = controllerDefinition.AdapterType.GetMethods().Select(m => m.Name).ToArray(); var actionResolver = new ActionResolver(this, methods); PathDictionary.PrependFinder(id.ItemType, actionResolver); } } } }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { builder.RegisterType<TwitterService>().As<ITwitterService>().InstancePerLifetimeScope(); //we cache presentation models between requests builder.RegisterType<WidgetsTwitterController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { builder.RegisterType<PromoUtilities>().As<IPromoUtilities>().InstancePerLifetimeScope(); builder.RegisterType<AttributeValueService>().As<IAttributeValueService>().InstancePerLifetimeScope(); builder.RegisterType<ProductMappingService>().As<IProductMappingService>().InstancePerLifetimeScope(); builder.RegisterType<PromoDetailService>().As<IPromoDetailService>().InstancePerLifetimeScope(); builder.RegisterType<ProductPromoMappingService>().As<IProductPromoMappingService>().InstancePerLifetimeScope(); builder.RegisterType<PromoPictureService>().As<IPromoPictureService>().InstancePerLifetimeScope(); builder.RegisterType<PromoBannerService>().As<IPromoBannerService>().InstancePerLifetimeScope(); builder.RegisterType<EfRepository<ProductMappingItem>>() .As<IRepository<ProductMappingItem>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<AttributeValueMappingItem>>() .As<IRepository<AttributeValueMappingItem>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<ProductAttributeConfigItem>>() .As<IRepository<ProductAttributeConfigItem>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<PromoDetail>>() .As<IRepository<PromoDetail>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<ProductPromotionMapping>>() .As<IRepository<ProductPromotionMapping>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<PromoPicture>>() .As<IRepository<PromoPicture>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<PromoBanner>>() .As<IRepository<PromoBanner>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<PromoBannerPicture>>() .As<IRepository<PromoBannerPicture>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<PromoBannerWidgetZone>>() .As<IRepository<PromoBannerWidgetZone>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); builder.RegisterType<EfRepository<IssuedCoupon>>() .As<IRepository<IssuedCoupon>>() .WithParameter(ResolvedParameter.ForNamed<IDbContext>("nop_object_context_promo")) .InstancePerLifetimeScope(); }
protected override void SetUp() { typesCache = NewMock<ITypesCache>(); typeFinder = NewMock<ITypeFinder>(); dataTypeFactory = NewMock<IDataTypeFactory>(); finder = new TypeInAssemblyFinder(GetType().Assembly, typesCache, dataTypeFactory); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { //we cache presentation models between requests builder.RegisterType<BlogController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<CatalogController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<CountryController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<CommonController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<NewsController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<PollController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<ProductController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<ShoppingCartController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<TopicController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); builder.RegisterType<WidgetController>() .WithParameter(ResolvedParameter.ForNamed<ICacheManager>("nop_cache_static")); //installation localization service builder.RegisterType<InstallationLocalizationService>().As<IInstallationLocalizationService>().InstancePerLifetimeScope(); }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { var webapiControllerAssemnblies = typeFinder.FindAssembliesWithTypeDerivatives<Saturn72ApiControllerBase>(); builder.RegisterApiControllers(webapiControllerAssemnblies.ToArray()); //var appDomainAssemblies = typeFinder.GetAssemblies().ToArray(); //builder.RegisterApiControllers(appDomainAssemblies); }
public void Register(IContainerManager containerManager, ITypeFinder typeFinder) { containerManager.AddComponent<IElementRepositoryFactory, LabelProvider.RepositoryFactory>(); containerManager.AddComponent<IPageProvider, PageProvider.PageProvider>(); containerManager.AddComponent<IHtmlBlockProvider, HtmlBlockProvider.HtmlBlockProvider>(); containerManager.AddComponent<IUserProvider, UserProvider.UserProvider>(); }
public void Register(IContainerManager containerManager, ITypeFinder typeFinder) { Kooboo.CMS.Sites.Globalization.DefaultRepositoryFactory.Instance = new LabelProvider.RepositoryFactory(); containerManager.AddComponent<IPageProvider, PageProvider.PageProvider>(); containerManager.AddComponent<IHtmlBlockProvider, HtmlBlockProvider.HtmlBlockProvider>(); containerManager.AddComponent<IUserProvider, UserProvider.UserProvider>(); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { //we cache presentation models between requests //installation localization service builder.RegisterType<InstallationLocalizationService>().As<IInstallationLocalizationService>().InstancePerLifetimeScope(); }
protected override void SetUp() { typeFinder = NewMock<ITypeFinder>(); memberReader = NewMock<IMemberReader>(); reader = new ValueTypeReader(memberReader, typeFinder); }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { //data layer builder.Register(x => new EfDataProviderManager(x.Resolve<DataSettings>())).As<BaseDataProviderManager>().InstancePerDependency(); builder.RegisterType(SqlServerDataProvider).As<IDataProvider>().InstancePerDependency(); if (dataProviderSettings != null && dataProviderSettings.IsValid()) { var efDataProviderManager = new EfDataProviderManager(dataSettingsManager.LoadSettings()); var dataProvider = efDataProviderManager.LoadDataProvider(); dataProvider.InitConnectionFactory(); builder.Register<IDbContext>(c => new NopObjectContext(dataProviderSettings.DataConnectionString)).InstancePerHttpRequest(); } else { builder.Register<IDbContext>(c => new NopObjectContext(dataSettingsManager.LoadSettings().DataConnectionString)).InstancePerHttpRequest(); } builder.RegisterGeneric(typeof(EfRepository<>)).As(typeof(IRepository<>)).InstancePerHttpRequest(); ////builder.RegisterType<ContentService>().As<IContentService>().InstancePerHttpRequest(); ////builder.RegisterType<NodeService>().As<INodeService>().InstancePerHttpRequest(); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { // we need to set up the cryptography internal services builder.RegisterType<HashService>().As<IHashService>().InstancePerDependency(); builder.RegisterType<AESService>().As<IAESService>().InstancePerDependency(); builder.RegisterType<RijndaelEnhancedService>().As<IRijndaelEnhancedService>().InstancePerDependency(); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, HeliosConfig config) { builder.RegisterType<PerRequestCacheManager>() .As<ICacheManager>() .Named<ICacheManager>("helios_cache_per_request") .InstancePerLifetimeScope(); }
public AppObjectReader(IReadObjectsCache readObjects, IApplicationObjectsRepository appObjectRepository, ITypeFinder typeFinder) { this.readObjects = readObjects; this.appObjectRepository = appObjectRepository; this.typeFinder = typeFinder; }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { builder.RegisterApiControllers(typeFinder.GetAssemblies().ToArray()); builder.RegisterType<R2DisasterContext>().As<IDbContext>().InstancePerRequest(); builder.RegisterGeneric(typeof(EFRepository<>)).As(typeof(IRepository<>)).InstancePerRequest(); builder.RegisterType<BookRepository>().As<IBookRepository>().InstancePerRequest(); builder.RegisterType<BookService>().As<IBookService>().InstancePerRequest(); builder.RegisterType<ComprehensiveService>().As<IComprehensiveService>().InstancePerRequest(); builder.RegisterType<DebrisFlowService>().As<IDebrisFlowService>().InstancePerRequest(); builder.RegisterType<PhyGeoDisasterService>().As<IPhyGeoDisasterService>().InstancePerRequest(); // builder.RegisterType<Phy>().As<IPhyGeoDisasterService>().InstancePerRequest(); builder.RegisterType<MassPreService>().As<IMassPreService>().InstancePerRequest(); builder.RegisterType<MonthlyReportService>().As<IMonthlyReportService>().InstancePerRequest(); builder.RegisterType<EmergencySurveyReportService>().As<IEmergencySurveyReportService>().InstancePerRequest(); //矿山复绿 builder.RegisterType<MineArchiveService>().As<IMineArchiveService>().InstancePerRequest(); builder.RegisterType<MineEnvironmentSurveyService>().As<IMineEnvironmentSurveyService>().InstancePerRequest(); builder.RegisterType<MineRemoteSensingCardService>().As<IMineRemoteSensingCardService>().InstancePerRequest(); //移民搬迁 builder.RegisterType<RelocationComprehensiveService>().As<IRelocationComprehensiveService>().InstancePerRequest(); builder.RegisterType<RelocationDebrisFlowCheckService>().As<IRelocationDebrisFlowCheckService>().InstancePerRequest(); builder.RegisterType<RelocationLandCollapseCheckService>().As<IRelocationLandCollapseCheckService>().InstancePerRequest(); builder.RegisterType<RelocationLandSlideCheckService>().As<IRelocationLandSlideCheckService>().InstancePerRequest(); builder.RegisterType<RelocationLandSlipCheckService>().As<IRelocationLandSlipCheckService>().InstancePerRequest(); builder.RegisterType<RelocationSlopeCheckService>().As<IRelocationSlopeCheckService>().InstancePerRequest(); builder.RegisterType<RelocationPlaceEvaluationService>().As<IRelocationPlaceEvaluationService>().InstancePerRequest(); builder.RegisterType<RainfallStationService>().As<IRainfallStationService>().InstancePerRequest(); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { var asm = AppDomain.CurrentDomain.GetAssemblies(); builder.RegisterGeneric(typeof(BaseEntityService<>)).As(typeof(IBaseEntityService<>)).InstancePerLifetimeScope(); builder.RegisterGeneric(typeof(BaseEntityWithPictureService<,>)).As(typeof(IBaseEntityWithPictureService<,>)).InstancePerLifetimeScope(); builder.RegisterType<MobPageHeadBuilder>().As<MobPageHeadBuilder>().InstancePerRequest(); //register all the implemented services in various mob plugins builder.RegisterAssemblyTypes(asm).AsClosedTypesOf(typeof(BaseEntityService<>)) .AsImplementedInterfaces() .InstancePerDependency(); builder.RegisterAssemblyTypes(asm).AsClosedTypesOf(typeof(BaseEntityWithPictureService<,>)) .AsImplementedInterfaces() .InstancePerDependency(); //register all the repositories builder.RegisterGeneric(typeof(MobRepository<>)).As(typeof(IMobRepository<>)) .WithParameter(ResolvedParameter.ForNamed<IDbContext>(ContextName)) .InstancePerLifetimeScope(); }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { RegisterPluginServices(builder); RegisterModelBinders(builder); }
public MetadataConfiguratorProviderSingleton(ITypeFinder typeFinder) { _typeFinder = typeFinder; }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder, NetProOption config) { //autofac方式注入dapper //builder.Register(c => new DefaultDapperContext(config.ConnectionStrings.ServerIdConnection["1"], DataProvider.Mysql)).InstancePerLifetimeScope(); }
/// <summary> /// Ctor /// </summary> /// <param name="typeFinder">Type finder</param> public RoutePublisher(ITypeFinder typeFinder) { _typeFinder = typeFinder; }
public void Register(IContainerManager containerManager, ITypeFinder typeFinder) { //containerManager.AddResolvingObserver(new ResolvingObserver()); }
/// <summary> /// Register services and interfaces /// </summary> /// <param name="services">Collection of service descriptors</param> /// <param name="typeFinder">Type finder</param> /// <param name="appSettings">App settings</param> public virtual void Register(IServiceCollection services, ITypeFinder typeFinder, AppSettings appSettings) { //installation localization service services.AddScoped <IInstallationLocalizationService, InstallationLocalizationService>(); //common factories services.AddScoped <IAclSupportedModelFactory, AclSupportedModelFactory>(); services.AddScoped <IDiscountSupportedModelFactory, DiscountSupportedModelFactory>(); services.AddScoped <ILocalizedModelFactory, LocalizedModelFactory>(); services.AddScoped <IStoreMappingSupportedModelFactory, StoreMappingSupportedModelFactory>(); //admin factories services.AddScoped <IBaseAdminModelFactory, BaseAdminModelFactory>(); services.AddScoped <IActivityLogModelFactory, ActivityLogModelFactory>(); services.AddScoped <IAddressModelFactory, AddressModelFactory>(); services.AddScoped <IAddressAttributeModelFactory, AddressAttributeModelFactory>(); services.AddScoped <IAffiliateModelFactory, AffiliateModelFactory>(); services.AddScoped <IBlogModelFactory, BlogModelFactory>(); services.AddScoped <ICampaignModelFactory, CampaignModelFactory>(); services.AddScoped <ICategoryModelFactory, CategoryModelFactory>(); services.AddScoped <ICheckoutAttributeModelFactory, CheckoutAttributeModelFactory>(); services.AddScoped <ICommonModelFactory, CommonModelFactory>(); services.AddScoped <ICountryModelFactory, CountryModelFactory>(); services.AddScoped <ICurrencyModelFactory, CurrencyModelFactory>(); services.AddScoped <ICustomerAttributeModelFactory, CustomerAttributeModelFactory>(); services.AddScoped <ICustomerModelFactory, CustomerModelFactory>(); services.AddScoped <ICustomerRoleModelFactory, CustomerRoleModelFactory>(); services.AddScoped <IDiscountModelFactory, DiscountModelFactory>(); services.AddScoped <IEmailAccountModelFactory, EmailAccountModelFactory>(); services.AddScoped <IExternalAuthenticationMethodModelFactory, ExternalAuthenticationMethodModelFactory>(); services.AddScoped <IForumModelFactory, ForumModelFactory>(); services.AddScoped <IGiftCardModelFactory, GiftCardModelFactory>(); services.AddScoped <IHomeModelFactory, HomeModelFactory>(); services.AddScoped <ILanguageModelFactory, LanguageModelFactory>(); services.AddScoped <ILogModelFactory, LogModelFactory>(); services.AddScoped <IManufacturerModelFactory, ManufacturerModelFactory>(); services.AddScoped <IMeasureModelFactory, MeasureModelFactory>(); services.AddScoped <IMessageTemplateModelFactory, MessageTemplateModelFactory>(); services.AddScoped <IMultiFactorAuthenticationMethodModelFactory, MultiFactorAuthenticationMethodModelFactory>(); services.AddScoped <INewsletterSubscriptionModelFactory, NewsletterSubscriptionModelFactory>(); services.AddScoped <INewsModelFactory, NewsModelFactory>(); services.AddScoped <IOrderModelFactory, OrderModelFactory>(); services.AddScoped <IPaymentModelFactory, PaymentModelFactory>(); services.AddScoped <IPluginModelFactory, PluginModelFactory>(); services.AddScoped <IPollModelFactory, PollModelFactory>(); services.AddScoped <IProductModelFactory, ProductModelFactory>(); services.AddScoped <IProductAttributeModelFactory, ProductAttributeModelFactory>(); services.AddScoped <IProductReviewModelFactory, ProductReviewModelFactory>(); services.AddScoped <IReportModelFactory, ReportModelFactory>(); services.AddScoped <IQueuedEmailModelFactory, QueuedEmailModelFactory>(); services.AddScoped <IRecurringPaymentModelFactory, RecurringPaymentModelFactory>(); services.AddScoped <IReturnRequestModelFactory, ReturnRequestModelFactory>(); services.AddScoped <IReviewTypeModelFactory, ReviewTypeModelFactory>(); services.AddScoped <IScheduleTaskModelFactory, ScheduleTaskModelFactory>(); services.AddScoped <ISecurityModelFactory, SecurityModelFactory>(); services.AddScoped <ISettingModelFactory, SettingModelFactory>(); services.AddScoped <IShippingModelFactory, ShippingModelFactory>(); services.AddScoped <IShoppingCartModelFactory, ShoppingCartModelFactory>(); services.AddScoped <ISpecificationAttributeModelFactory, SpecificationAttributeModelFactory>(); services.AddScoped <IStoreModelFactory, StoreModelFactory>(); services.AddScoped <ITaxModelFactory, TaxModelFactory>(); services.AddScoped <ITemplateModelFactory, TemplateModelFactory>(); services.AddScoped <ITopicModelFactory, TopicModelFactory>(); services.AddScoped <IVendorAttributeModelFactory, VendorAttributeModelFactory>(); services.AddScoped <IVendorModelFactory, VendorModelFactory>(); services.AddScoped <IWidgetModelFactory, WidgetModelFactory>(); //factories services.AddScoped <Factories.IAddressModelFactory, Factories.AddressModelFactory>(); services.AddScoped <Factories.IBlogModelFactory, Factories.BlogModelFactory>(); services.AddScoped <Factories.ICatalogModelFactory, Factories.CatalogModelFactory>(); services.AddScoped <Factories.ICheckoutModelFactory, Factories.CheckoutModelFactory>(); services.AddScoped <Factories.ICommonModelFactory, Factories.CommonModelFactory>(); services.AddScoped <Factories.ICountryModelFactory, Factories.CountryModelFactory>(); services.AddScoped <Factories.ICustomerModelFactory, Factories.CustomerModelFactory>(); services.AddScoped <Factories.IForumModelFactory, Factories.ForumModelFactory>(); services.AddScoped <Factories.IExternalAuthenticationModelFactory, Factories.ExternalAuthenticationModelFactory>(); services.AddScoped <Factories.INewsModelFactory, Factories.NewsModelFactory>(); services.AddScoped <Factories.INewsletterModelFactory, Factories.NewsletterModelFactory>(); services.AddScoped <Factories.IOrderModelFactory, Factories.OrderModelFactory>(); services.AddScoped <Factories.IPollModelFactory, Factories.PollModelFactory>(); services.AddScoped <Factories.IPrivateMessagesModelFactory, Factories.PrivateMessagesModelFactory>(); services.AddScoped <Factories.IProductModelFactory, Factories.ProductModelFactory>(); services.AddScoped <Factories.IProfileModelFactory, Factories.ProfileModelFactory>(); services.AddScoped <Factories.IReturnRequestModelFactory, Factories.ReturnRequestModelFactory>(); services.AddScoped <Factories.IShoppingCartModelFactory, Factories.ShoppingCartModelFactory>(); services.AddScoped <Factories.ITopicModelFactory, Factories.TopicModelFactory>(); services.AddScoped <Factories.IVendorModelFactory, Factories.VendorModelFactory>(); services.AddScoped <Factories.IWidgetModelFactory, Factories.WidgetModelFactory>(); }
protected ServiceBase() { UnitOfWorkManager = PlusEngine.Instance.Resolve <IUnitOfWorkManager>(); TypeFinder = PlusEngine.Instance.Resolve <ITypeFinder>(); }
public ArrayOfObjectsReader(IReadObjectsCache readObjects, IObjectReader objectReader, ITypeFinder typeFinder) { this.readObjects = readObjects; this.objectReader = objectReader; this.typeFinder = typeFinder; }
/// <summary> /// 构造函数 /// </summary> /// <param name="typeFinder"></param> public RoutePublisher(ITypeFinder typeFinder) { this.typeFinder = typeFinder; }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder, IConfiguration configuration) { builder.RegisterGeneric(typeof(DatabaseLogic <>)).As(typeof(IDatabaseLogic <>)).InstancePerLifetimeScope(); }
/// <summary> /// Register services and interfaces /// </summary> /// <param name="builder">Container builder</param> /// <param name="typeFinder">Type finder</param> /// <param name="config">Config</param> public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { builder.RegisterType <ExternalAuthenticationService_Override>().As <IExternalAuthenticationService>().InstancePerLifetimeScope(); }
/// <summary> /// Register services and interfaces /// </summary> /// <param name="builder">Container builder</param> /// <param name="typeFinder">Type finder</param> /// <param name="config">Config</param> public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { builder.RegisterType <KuveytTurkService>().AsSelf().InstancePerLifetimeScope(); }
public AbpAutoMapperModule(ITypeFinder typeFinder) { _typeFinder = typeFinder; Logger = NullLogger.Instance; LocalizationManager = NullLocalizationManager.Instance; }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder) { builder.RegisterType <ZarinpalMenu>().As <IAdminAreaPluginMenu>().InstancePerLifetimeScope(); }
/// <summary> /// Add and configure any of the middleware /// </summary> /// <param name="services">Collection of service descriptors</param> /// <param name="configuration">Configuration root of the application</param> public void ConfigureServices(IServiceCollection services, IConfiguration configuration, ITypeFinder typeFinder) { //compression services.AddResponseCompression(); //add options feature services.AddOptions(); //新增redis缓存注入 //TODO 映射异常,待修复 services.AddRedisManager(configuration); //新增MongoDb注入 services.AddMongoDb(); }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { builder.RegisterType <InstallationLocalizationService>().As <IInstallationLocalizationService>().InstancePerLifetimeScope(); builder.RegisterType <WidgetController>().WithParameter(ResolvedParameter.ForNamed <ICacheManager>("nop_cache_static")); }
public void ConfigureServices(IServiceCollection services, IConfiguration configuration = null, ITypeFinder typeFinder = null) { services.Scan(scan => scan .FromAssemblies(typeFinder.GetAssemblies().Where(s => s.GetName().Name.EndsWith("Leon.XXX.Domain")).ToArray()) .AddClasses(classes => classes.Where(type => type.Name.EndsWith("Repository"))) .AsImplementedInterfaces() .WithScopedLifetime()); var option = configuration.GetSection(nameof(VerifySignOption)).Get <VerifySignOption>(); //覆盖请求签名组件 services.AddVerifySign(s => { //自定义签名摘要逻辑 s.OperationFilter <VerifySignCustomer>(); }); var connectionString = configuration.GetValue <string>("ConnectionStrings:MysqlConnection"); Fsql = new FreeSql.FreeSqlBuilder() .UseConnectionString(FreeSql.DataType.MySql, connectionString) .UseAutoSyncStructure(false) //自动同步实体结构到数据库 .Build(); //请务必定义成 Singleton 单例模式 services.AddSingleton <IFreeSql>(Fsql); services.AddFreeRepository(null, this.GetType().Assembly);//批量注入Repository //services.AddRabbitMqClient(new RabbitMqClientOptions //{ // HostName = "198.89.70.56", // Port = 5672, // Password = "******", // UserName = "******", // VirtualHost = "/", //}) // .AddProductionExchange("exchange", new RabbitMqExchangeOptions // { // DeadLetterExchange = "DeadExchange", // AutoDelete = false, // Type = ExchangeType.Direct, // Durable = true, // Queues = new List<RabbitMqQueueOptions> { // new RabbitMqQueueOptions { AutoDelete = false, Exclusive = false, Durable = true, Name = "exchange" , RoutingKeys = new HashSet<string> { string.Empty } } } // }) // .AddConsumptionExchange($"exchange", new RabbitMqExchangeOptions // { // DeadLetterExchange = "DeadExchange", // AutoDelete = false, // Type = ExchangeType.Direct, // Durable = true, // Queues = new List<RabbitMqQueueOptions> { new RabbitMqQueueOptions { AutoDelete = false, Exclusive = false, Durable = true, Name= "exchange", RoutingKeys = new HashSet<string> { string.Empty } } } // }) // .AddMessageHandlerSingleton<CustomerMessageHandler>(string.Empty); //services.BuildServiceProvider().GetRequiredService<IQueueService>().StartConsuming(); }
/// <summary> /// Register services and interfaces /// </summary> /// <param name="builder">Container builder</param> /// <param name="typeFinder">Type finder</param> /// <param name="config">Config</param> public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, GrandConfig config) { //web helper builder.RegisterType <WebHelper>().As <IWebHelper>().InstancePerLifetimeScope(); //user agent helper builder.RegisterType <UserAgentHelper>().As <IUserAgentHelper>().InstancePerLifetimeScope(); //powered by builder.RegisterType <PoweredByMiddlewareOptions>().As <IPoweredByMiddlewareOptions>().SingleInstance(); //data layer var dataSettingsManager = new DataSettingsManager(); var dataProviderSettings = dataSettingsManager.LoadSettings(); builder.Register(c => dataSettingsManager.LoadSettings()).As <DataSettings>(); builder.Register(x => new MongoDBDataProviderManager(x.Resolve <DataSettings>())).As <BaseDataProviderManager>().InstancePerDependency(); builder.Register(x => x.Resolve <BaseDataProviderManager>().LoadDataProvider()).As <IDataProvider>().InstancePerDependency(); if (dataProviderSettings != null && dataProviderSettings.IsValid()) { var connectionString = dataProviderSettings.DataConnectionString; var databaseName = new MongoUrl(connectionString).DatabaseName; builder.Register(c => new MongoClient(connectionString).GetDatabase(databaseName)).SingleInstance(); builder.Register <IMongoDBContext>(c => new MongoDBContext(connectionString)).InstancePerLifetimeScope(); } else { builder.RegisterType <MongoDBContext>().As <IMongoDBContext>().InstancePerLifetimeScope(); } //MongoDbRepository builder.RegisterGeneric(typeof(MongoDBRepository <>)).As(typeof(IRepository <>)).InstancePerLifetimeScope(); //plugins builder.RegisterType <PluginFinder>().As <IPluginFinder>().InstancePerLifetimeScope(); //cache manager builder.RegisterType <PerRequestCacheManager>().InstancePerLifetimeScope(); //cache manager if (config.RedisCachingEnabled) { builder.RegisterType <MemoryCacheManager>().As <ICacheManager>().Named <ICacheManager>("grand_cache_static").SingleInstance(); builder.RegisterType <RedisConnectionWrapper>().As <IRedisConnectionWrapper>().SingleInstance(); builder.RegisterType <RedisCacheManager>().As <ICacheManager>().InstancePerLifetimeScope(); } else { builder.RegisterType <MemoryCacheManager>().As <ICacheManager>().Named <ICacheManager>("grand_cache_static").SingleInstance(); } if (config.RunOnAzureWebApps) { builder.RegisterType <AzureWebAppsMachineNameProvider>().As <IMachineNameProvider>().SingleInstance(); } else { builder.RegisterType <DefaultMachineNameProvider>().As <IMachineNameProvider>().SingleInstance(); } //work context builder.RegisterType <WebWorkContext>().As <IWorkContext>().InstancePerLifetimeScope(); //store context builder.RegisterType <WebStoreContext>().As <IStoreContext>().InstancePerLifetimeScope(); //services builder.RegisterType <BackInStockSubscriptionService>().As <IBackInStockSubscriptionService>().InstancePerLifetimeScope(); builder.RegisterType <CategoryService>().As <ICategoryService>().InstancePerLifetimeScope(); builder.RegisterType <CompareProductsService>().As <ICompareProductsService>().InstancePerLifetimeScope(); builder.RegisterType <RecentlyViewedProductsService>().As <IRecentlyViewedProductsService>().InstancePerLifetimeScope(); builder.RegisterType <ManufacturerService>().As <IManufacturerService>().InstancePerLifetimeScope(); builder.RegisterType <PriceFormatter>().As <IPriceFormatter>().InstancePerLifetimeScope(); builder.RegisterType <ProductAttributeFormatter>().As <IProductAttributeFormatter>().InstancePerLifetimeScope(); builder.RegisterType <ProductAttributeParser>().As <IProductAttributeParser>().InstancePerLifetimeScope(); builder.RegisterType <ProductAttributeService>().As <IProductAttributeService>().InstancePerLifetimeScope(); builder.RegisterType <ProductService>().As <IProductService>().InstancePerLifetimeScope(); builder.RegisterType <CopyProductService>().As <ICopyProductService>().InstancePerLifetimeScope(); builder.RegisterType <ProductReservationService>().As <IProductReservationService>().InstancePerLifetimeScope(); builder.RegisterType <AuctionService>().As <IAuctionService>().InstancePerLifetimeScope(); builder.RegisterType <SpecificationAttributeService>().As <ISpecificationAttributeService>().InstancePerLifetimeScope(); builder.RegisterType <ProductTemplateService>().As <IProductTemplateService>().InstancePerLifetimeScope(); builder.RegisterType <CategoryTemplateService>().As <ICategoryTemplateService>().InstancePerLifetimeScope(); builder.RegisterType <ManufacturerTemplateService>().As <IManufacturerTemplateService>().InstancePerLifetimeScope(); builder.RegisterType <TopicTemplateService>().As <ITopicTemplateService>().InstancePerLifetimeScope(); builder.RegisterType <ProductTagService>().As <IProductTagService>().InstancePerLifetimeScope(); builder.RegisterType <AddressAttributeFormatter>().As <IAddressAttributeFormatter>().InstancePerLifetimeScope(); builder.RegisterType <AddressAttributeParser>().As <IAddressAttributeParser>().InstancePerLifetimeScope(); builder.RegisterType <AddressAttributeService>().As <IAddressAttributeService>().InstancePerLifetimeScope(); builder.RegisterType <AddressService>().As <IAddressService>().InstancePerLifetimeScope(); builder.RegisterType <AffiliateService>().As <IAffiliateService>().InstancePerLifetimeScope(); builder.RegisterType <VendorService>().As <IVendorService>().InstancePerLifetimeScope(); builder.RegisterType <SearchTermService>().As <ISearchTermService>().InstancePerLifetimeScope(); builder.RegisterType <GenericAttributeService>().As <IGenericAttributeService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerAttributeFormatter>().As <ICustomerAttributeFormatter>().InstancePerLifetimeScope(); builder.RegisterType <CustomerAttributeParser>().As <ICustomerAttributeParser>().InstancePerLifetimeScope(); builder.RegisterType <CustomerAttributeService>().As <ICustomerAttributeService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerService>().As <ICustomerService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerRegistrationService>().As <ICustomerRegistrationService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReportService>().As <ICustomerReportService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerTagService>().As <ICustomerTagService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerActionService>().As <ICustomerActionService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerActionEventService>().As <ICustomerActionEventService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReminderService>().As <ICustomerReminderService>().InstancePerLifetimeScope(); builder.RegisterType <RewardPointsService>().As <IRewardPointsService>().InstancePerLifetimeScope(); builder.RegisterType <PermissionService>().As <IPermissionService>().InstancePerLifetimeScope(); builder.RegisterType <AclService>().As <IAclService>().InstancePerLifetimeScope(); builder.RegisterType <PriceCalculationService>().As <IPriceCalculationService>().InstancePerLifetimeScope(); builder.RegisterType <GeoLookupService>().As <IGeoLookupService>().InstancePerLifetimeScope(); builder.RegisterType <CountryService>().As <ICountryService>().InstancePerLifetimeScope(); builder.RegisterType <CurrencyService>().As <ICurrencyService>().InstancePerLifetimeScope(); builder.RegisterType <MeasureService>().As <IMeasureService>().InstancePerLifetimeScope(); builder.RegisterType <StateProvinceService>().As <IStateProvinceService>().InstancePerLifetimeScope(); builder.RegisterType <StoreService>().As <IStoreService>().InstancePerLifetimeScope(); builder.RegisterType <StoreMappingService>().As <IStoreMappingService>().InstancePerLifetimeScope(); builder.RegisterType <DiscountService>().As <IDiscountService>().InstancePerLifetimeScope(); if (config.RedisCachingEnabled) { builder.RegisterType <SettingService>().As <ISettingService>() .WithParameter(ResolvedParameter.ForNamed <ICacheManager>("grand_cache_static")) .InstancePerLifetimeScope(); builder.RegisterType <LocalizationService>().As <ILocalizationService>() .WithParameter(ResolvedParameter.ForNamed <ICacheManager>("grand_cache_static")) .InstancePerLifetimeScope(); } else { builder.RegisterType <SettingService>().As <ISettingService>().InstancePerLifetimeScope(); builder.RegisterType <LocalizationService>().As <ILocalizationService>().InstancePerLifetimeScope(); } builder.RegisterType <LanguageService>().As <ILanguageService>().InstancePerLifetimeScope(); builder.RegisterType <DownloadService>().As <IDownloadService>().InstancePerLifetimeScope(); //picture service var useAzureBlobStorage = !String.IsNullOrEmpty(config.AzureBlobStorageConnectionString); var useAmazonBlobStorage = (!String.IsNullOrEmpty(config.AmazonAwsAccessKeyId) && !String.IsNullOrEmpty(config.AmazonAwsSecretAccessKey) && !String.IsNullOrEmpty(config.AmazonBucketName) && !String.IsNullOrEmpty(config.AmazonRegion)); if (useAzureBlobStorage) { //Windows Azure BLOB builder.RegisterType <AzurePictureService>().As <IPictureService>().InstancePerLifetimeScope(); } else if (useAmazonBlobStorage) { //Amazon S3 Simple Storage Service builder.RegisterType <AmazonPictureService>().As <IPictureService>().InstancePerLifetimeScope(); } else { //standard file system builder.RegisterType <PictureService>().As <IPictureService>().InstancePerLifetimeScope(); } builder.RegisterType <MessageTemplateService>().As <IMessageTemplateService>().InstancePerLifetimeScope(); builder.RegisterType <QueuedEmailService>().As <IQueuedEmailService>().InstancePerLifetimeScope(); builder.RegisterType <NewsLetterSubscriptionService>().As <INewsLetterSubscriptionService>().InstancePerLifetimeScope(); builder.RegisterType <NewsletterCategoryService>().As <INewsletterCategoryService>().InstancePerLifetimeScope(); builder.RegisterType <CampaignService>().As <ICampaignService>().InstancePerLifetimeScope(); builder.RegisterType <BannerService>().As <IBannerService>().InstancePerLifetimeScope(); builder.RegisterType <PopupService>().As <IPopupService>().InstancePerLifetimeScope(); builder.RegisterType <InteractiveFormService>().As <IInteractiveFormService>().InstancePerLifetimeScope(); builder.RegisterType <EmailAccountService>().As <IEmailAccountService>().InstancePerLifetimeScope(); builder.RegisterType <WorkflowMessageService>().As <IWorkflowMessageService>().InstancePerLifetimeScope(); builder.RegisterType <ContactAttributeFormatter>().As <IContactAttributeFormatter>().InstancePerLifetimeScope(); builder.RegisterType <ContactAttributeParser>().As <IContactAttributeParser>().InstancePerLifetimeScope(); builder.RegisterType <ContactAttributeService>().As <IContactAttributeService>().InstancePerLifetimeScope(); builder.RegisterType <MessageTokenProvider>().As <IMessageTokenProvider>().InstancePerLifetimeScope(); builder.RegisterType <Tokenizer>().As <ITokenizer>().InstancePerLifetimeScope(); builder.RegisterType <EmailSender>().As <IEmailSender>().InstancePerLifetimeScope(); builder.RegisterType <HistoryService>().As <IHistoryService>().InstancePerLifetimeScope(); builder.RegisterType <CheckoutAttributeFormatter>().As <ICheckoutAttributeFormatter>().InstancePerLifetimeScope(); builder.RegisterType <CheckoutAttributeParser>().As <ICheckoutAttributeParser>().InstancePerLifetimeScope(); builder.RegisterType <CheckoutAttributeService>().As <ICheckoutAttributeService>().InstancePerLifetimeScope(); builder.RegisterType <GiftCardService>().As <IGiftCardService>().InstancePerLifetimeScope(); builder.RegisterType <OrderService>().As <IOrderService>().InstancePerLifetimeScope(); builder.RegisterType <OrderReportService>().As <IOrderReportService>().InstancePerLifetimeScope(); builder.RegisterType <OrderProcessingService>().As <IOrderProcessingService>().InstancePerLifetimeScope(); builder.RegisterType <OrderTotalCalculationService>().As <IOrderTotalCalculationService>().InstancePerLifetimeScope(); builder.RegisterType <ReturnRequestService>().As <IReturnRequestService>().InstancePerLifetimeScope(); builder.RegisterType <RewardPointsService>().As <IRewardPointsService>().InstancePerLifetimeScope(); builder.RegisterType <ShoppingCartService>().As <IShoppingCartService>().InstancePerLifetimeScope(); builder.RegisterType <PaymentService>().As <IPaymentService>().InstancePerLifetimeScope(); builder.RegisterType <EncryptionService>().As <IEncryptionService>().InstancePerLifetimeScope(); builder.RegisterType <CookieAuthenticationService>().As <IGrandAuthenticationService>().InstancePerLifetimeScope(); builder.RegisterType <UrlRecordService>().As <IUrlRecordService>().InstancePerLifetimeScope(); builder.RegisterType <ShipmentService>().As <IShipmentService>().InstancePerLifetimeScope(); builder.RegisterType <ShippingService>().As <IShippingService>().InstancePerLifetimeScope(); builder.RegisterType <TaxCategoryService>().As <ITaxCategoryService>().InstancePerLifetimeScope(); builder.RegisterType <TaxService>().As <ITaxService>().InstancePerLifetimeScope(); builder.RegisterType <TaxCategoryService>().As <ITaxCategoryService>().InstancePerLifetimeScope(); builder.RegisterType <DefaultLogger>().As <ILogger>().InstancePerLifetimeScope(); builder.RegisterType <ContactUsService>().As <IContactUsService>().InstancePerLifetimeScope(); builder.RegisterType <CustomerActivityService>().As <ICustomerActivityService>().InstancePerLifetimeScope(); builder.RegisterType <ActivityKeywordsProvider>().As <IActivityKeywordsProvider>().InstancePerLifetimeScope(); bool databaseInstalled = DataSettingsHelper.DatabaseIsInstalled(); if (!databaseInstalled) { //installation service builder.RegisterType <CodeFirstInstallationService>().As <IInstallationService>().InstancePerLifetimeScope(); } else { builder.RegisterType <UpgradeService>().As <IUpgradeService>().InstancePerLifetimeScope(); } builder.RegisterType <ForumService>().As <IForumService>().InstancePerLifetimeScope(); builder.RegisterType <KnowledgebaseService>().As <IKnowledgebaseService>().InstancePerLifetimeScope(); builder.RegisterType <PushNotificationsService>().As <IPushNotificationsService>().InstancePerLifetimeScope(); builder.RegisterType <PollService>().As <IPollService>().InstancePerLifetimeScope(); builder.RegisterType <BlogService>().As <IBlogService>().InstancePerLifetimeScope(); builder.RegisterType <WidgetService>().As <IWidgetService>().InstancePerLifetimeScope(); builder.RegisterType <TopicService>().As <ITopicService>().InstancePerLifetimeScope(); builder.RegisterType <NewsService>().As <INewsService>().InstancePerLifetimeScope(); builder.RegisterType <DateTimeHelper>().As <IDateTimeHelper>().InstancePerLifetimeScope(); builder.RegisterType <SitemapGenerator>().As <ISitemapGenerator>().InstancePerLifetimeScope(); builder.RegisterType <PageHeadBuilder>().As <IPageHeadBuilder>().InstancePerLifetimeScope(); builder.RegisterType <ScheduleTaskService>().As <IScheduleTaskService>().InstancePerLifetimeScope(); builder.RegisterType <ExportManager>().As <IExportManager>().InstancePerLifetimeScope(); builder.RegisterType <ImportManager>().As <IImportManager>().InstancePerLifetimeScope(); builder.RegisterType <PdfService>().As <IPdfService>().InstancePerLifetimeScope(); builder.RegisterType <ThemeProvider>().As <IThemeProvider>().InstancePerLifetimeScope(); builder.RegisterType <ThemeContext>().As <IThemeContext>().InstancePerLifetimeScope(); builder.RegisterType <ExternalAuthenticationService>().As <IExternalAuthenticationService>().InstancePerLifetimeScope(); builder.RegisterType <GoogleAnalyticsService>().As <IGoogleAnalyticsService>().InstancePerLifetimeScope(); builder.RegisterType <RoutePublisher>().As <IRoutePublisher>().SingleInstance(); //Register event consumers var consumers = typeFinder.FindClassesOfType(typeof(IConsumer <>)).ToList(); foreach (var consumer in consumers) { builder.RegisterType(consumer) .As(consumer.GetTypeInfo().FindInterfaces((type, criteria) => { var isMatch = type.GetTypeInfo().IsGenericType&& ((Type)criteria).IsAssignableFrom(type.GetGenericTypeDefinition()); return(isMatch); }, typeof(IConsumer <>))) .InstancePerLifetimeScope(); } builder.RegisterType <ResourceManager>().As <IResourceManager>().InstancePerLifetimeScope(); builder.RegisterType <EventPublisher>().As <IEventPublisher>().SingleInstance(); builder.RegisterType <SubscriptionService>().As <ISubscriptionService>().SingleInstance(); //TASKS builder.RegisterType <QueuedMessagesSendScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <ClearCacheScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <ClearLogScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReminderAbandonedCartScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReminderBirthdayScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReminderCompletedOrderScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReminderLastActivityScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReminderLastPurchaseScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReminderRegisteredCustomerScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <CustomerReminderUnpaidOrderScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <DeleteGuestsScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <UpdateExchangeRateScheduleTask>().InstancePerLifetimeScope(); builder.RegisterType <EndAuctionsTask>().InstancePerLifetimeScope(); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder) { //HTTP context and other related stuff builder.Register(c => //register FakeHttpContext when HttpContext is not available HttpContext.Current != null ? (new HttpContextWrapper(HttpContext.Current) as HttpContextBase) : (new FakeHttpContext("~/") as HttpContextBase)) .As <HttpContextBase>() .InstancePerRequest(); builder.Register(c => c.Resolve <HttpContextBase>().Request) .As <HttpRequestBase>() .InstancePerRequest(); builder.Register(c => c.Resolve <HttpContextBase>().Response) .As <HttpResponseBase>() .InstancePerRequest(); builder.Register(c => c.Resolve <HttpContextBase>().Server) .As <HttpServerUtilityBase>() .InstancePerRequest(); builder.Register(c => c.Resolve <HttpContextBase>().Session) .As <HttpSessionStateBase>() .InstancePerRequest(); //cache manager builder.RegisterType <MemoryCacheManager>().As <ICacheManager>().Named <ICacheManager>("axis_cache_static").SingleInstance(); // Added logger's constructor parameter builder.RegisterType <Logger>().As <ILogger>().WithParameter("enableLogging", (ApplicationSettings.EnableLogging && ApplicationSettings.LoggingMode == (int)LoggingMode.File)).InstancePerLifetimeScope(); builder.RegisterType <LoggingRepository>().As <ILoggingRepository>().InstancePerLifetimeScope(); builder.RegisterType <AccountRepository>().As <IAccountRepository>().InstancePerLifetimeScope(); builder.RegisterType <ForgotPasswordRepository>().As <IForgotPasswordRepository>().InstancePerLifetimeScope(); builder.RegisterType <SecurityRepository>().As <ISecurityRepository>().InstancePerLifetimeScope(); builder.RegisterType <CacheRepository>().As <ICacheRepository>(); builder.RegisterType <AdminRepository>().As <IAdminRepository>(); builder.RegisterType <ConfigurationRepository>().As <IConfigurationRepository>(); builder.RegisterType <LookupRepository>().As <ILookupRepository>(); builder.RegisterType <UserProfileRepository>().As <IUserProfileRepository>(); builder.RegisterType <AssessmentRepository>().As <IAssessmentRepository>(); builder.RegisterType <PhotoRepository>().As <IPhotoRepository>(); builder.RegisterType <ClientAuditRepository>().As <IClientAuditRepository>(); builder.RegisterType <WorkflowHeaderRepository>().As <IWorkflowHeaderRepository>(); builder.RegisterType <StaffManagementRepository>().As <IStaffManagementRepository>(); builder.RegisterType <UserDetailRepository>().As <IUserDetailRepository>(); builder.RegisterType <UserRoleRepository>().As <IUserRoleRepository>(); builder.RegisterType <UserCredentialRepository>().As <IUserCredentialRepository>(); builder.RegisterType <UserHeaderRepository>().As <IUserHeaderRepository>(); builder.RegisterType <DivisionProgramRepository>().As <IDivisionProgramRepository>(); builder.RegisterType <UserSchedulingRepository>().As <IUserSchedulingRepository>(); builder.RegisterType <UserPhotoRepository>().As <IUserPhotoRepository>(); builder.RegisterType <UserDirectReportsRepository>().As <IUserDirectReportsRepository>(); builder.RegisterType <UserSecurityRepository>().As <IUserSecurityRepository>(); builder.RegisterType <RoutePublisher>().As <IRoutePublisher>().SingleInstance(); builder.RegisterType <HttpRoutePublisher>().As <IHttpRoutePublisher>().SingleInstance(); builder.RegisterType <BundlePublisher>().As <IBundlePublisher>().SingleInstance(); builder.RegisterType <AppDomainTypeFinder>().As <ITypeFinder>().SingleInstance(); builder.RegisterType <ServiceRecordingRepository>().As <IServiceRecordingRepository>(); builder.RegisterType <VoidServiceRepository>().As <IVoidServiceRepository>(); builder.RegisterType <ConsentsRepository>().As <IConsentsRepository>(); builder.RegisterType <RoleManagementRepository>().As <IRoleManagementRepository>(); builder.RegisterType <ClientMergeRepository>().As <IClientMergeRepository>(); builder.RegisterType <ProvidersRepository>().As <IProvidersRepository>(); builder.RegisterType <HealthRecordsRepository>().As <IHealthRecordsRepository>(); builder.RegisterType <PayorsRepository>().As <IPayorsRepository>(); builder.RegisterType <PayorPlansRepository>().As <IPayorPlansRepository>(); builder.RegisterType <PlanAddressesRepository>().As <IPlanAddressesRepository>(); builder.RegisterType <OrganizationStructureRepository>().As <IOrganizationStructureRepository>(); builder.RegisterType <CompanyRepository>().As <ICompanyRepository>(); builder.RegisterType <DivisionRepository>().As <IDivisionRepository>(); builder.RegisterType <ProgramRepository>().As <IProgramRepository>(); builder.RegisterType <ProgramUnitsRepository>().As <IProgramUnitsRepository>(); builder.RegisterType <ServiceDefinitionRepository>().As <IServiceDefinitionRepository>(); builder.RegisterType <ServiceDetailsRepository>().As <IServiceDetailsRepository>(); builder.RegisterType <PluginFinder>().As <IPluginFinder>().InstancePerLifetimeScope(); builder.RegisterType <WebHelper>().As <IWebHelper>().InstancePerLifetimeScope(); var allAssemblies = typeFinder.GetAssemblies().ToArray(); builder.RegisterControllers(allAssemblies); builder.RegisterApiControllers(allAssemblies); }
public EmbeddedViewResolver(ITypeFinder typeFinder) { this._typeFinder = typeFinder; }
/// <summary> /// Register dependencies /// </summary> /// <param name="services">Collection of service descriptors</param> /// <param name="typeFinder">Type finder</param> /// <param name="nopConfig">QNet configuration parameters</param> protected virtual IServiceProvider RegisterDependencies(IServiceCollection services, ITypeFinder typeFinder, QNetConfig nopConfig) { var containerBuilder = new ContainerBuilder(); //register engine containerBuilder.RegisterInstance(this).As <IEngine>().SingleInstance(); //register type finder containerBuilder.RegisterInstance(typeFinder).As <ITypeFinder>().SingleInstance(); //populate Autofac container builder with the set of registered service descriptors containerBuilder.Populate(services); //find dependency registrars provided by other assemblies var dependencyRegistrars = typeFinder.FindClassesOfType <IDependencyRegistrar>(); //create and sort instances of dependency registrars var instances = dependencyRegistrars .Select(dependencyRegistrar => (IDependencyRegistrar)Activator.CreateInstance(dependencyRegistrar)) .OrderBy(dependencyRegistrar => dependencyRegistrar.Order); //register all provided dependencies foreach (var dependencyRegistrar in instances) { dependencyRegistrar.Register(containerBuilder, typeFinder, nopConfig); } //create service provider _serviceProvider = new AutofacServiceProvider(containerBuilder.Build()); return(_serviceProvider); }
public AbpEntityFrameworkModule(ITypeFinder typeFinder) { _typeFinder = typeFinder; Logger = NullLogger.Instance; }
public void ConfigureServices(IServiceCollection services, IConfiguration configuration, ITypeFinder typeFinder) { //TODO APM按需实现 return; var config = services.BuildServiceProvider().GetRequiredService <NetProOption>(); if (!config.APMEnabled) { return; } var connectionString = config.ConnectionStrings?.DecryptDefaultConnection; var influxOptions = new MetricsReportingInfluxDbOptions(); configuration.GetSection(nameof(MetricsReportingInfluxDbOptions)).Bind(influxOptions); //var esOptions = new MetricsReportingElasticsearchOptions(); //configuration.GetSection(nameof(MetricsReportingElasticsearchOptions)).Bind(esOptions); var metricsBuilder = AppMetrics.CreateDefaultBuilder() .Configuration.ReadFrom(configuration); if (influxOptions != null) { metricsBuilder = metricsBuilder.Report.ToInfluxDb(influxOptions); } //if (esOptions!= null) //{ // metricsBuilder = metricsBuilder.Report.ToElasticsearch(esOptions); //} var metricsRoot = metricsBuilder.Build(); services.AddMetrics(metricsRoot); services.AddMetricsReportingHostedService(); services.AddMetricsTrackingMiddleware(configuration); services.AddMetricsEndpoints(configuration); //健康检测 //var metricsHealth = AppMetricsHealth.CreateDefaultBuilder() // .Configuration.ReadFrom(configuration) //.HealthChecks.RegisterFromAssembly(services) //.HealthChecks.AddPingCheck("ping 百度", "www.baidu.com", TimeSpan.FromSeconds(5)) //.HealthChecks.AddHttpGetCheck("官网", new Uri("http://wwww.NetPro.com.cn"), TimeSpan.FromSeconds(30)) //.HealthChecks.AddProcessPhysicalMemoryCheck("占用内存是否超过1G", 1024*1024*1024) //.HealthChecks.AddSqlCheck("数据库连接检测", connectionString, TimeSpan.FromSeconds(60)) //.BuildAndAddTo(services); //services.AddHealth(metricsHealth); //services.AddHealthEndpoints(configuration); }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, GrandConfig config) { //installation localization service builder.RegisterType <InstallationLocalizationService>().As <IInstallationLocalizationService>().InstancePerLifetimeScope(); //blog service builder.RegisterType <BlogViewModelService>().As <IBlogViewModelService>().InstancePerLifetimeScope(); //address service builder.RegisterType <AddressViewModelService>().As <IAddressViewModelService>().InstancePerLifetimeScope(); //catalog service builder.RegisterType <CatalogViewModelService>().As <ICatalogViewModelService>().InstancePerLifetimeScope(); //product service builder.RegisterType <ProductViewModelService>().As <IProductViewModelService>().InstancePerLifetimeScope(); //news service builder.RegisterType <NewsViewModelService>().As <INewsViewModelService>().InstancePerLifetimeScope(); //topic service builder.RegisterType <TopicViewModelService>().As <ITopicViewModelService>().InstancePerLifetimeScope(); //customer service builder.RegisterType <CustomerViewModelService>().As <ICustomerViewModelService>().InstancePerLifetimeScope(); //common service builder.RegisterType <CommonViewModelService>().As <ICommonViewModelService>().InstancePerLifetimeScope(); //shipping service builder.RegisterType <ShoppingCartViewModelService>().As <IShoppingCartViewModelService>().InstancePerLifetimeScope(); //externalAuth service builder.RegisterType <ExternalAuthenticationViewModelService>().As <IExternalAuthenticationViewModelService>().InstancePerLifetimeScope(); //widgetZone servie builder.RegisterType <WidgetViewModelService>().As <IWidgetViewModelService>().InstancePerLifetimeScope(); //order service builder.RegisterType <OrderViewModelService>().As <IOrderViewModelService>().InstancePerLifetimeScope(); //country service builder.RegisterType <CountryViewModelService>().As <ICountryViewModelService>().InstancePerLifetimeScope(); //checkout service builder.RegisterType <CheckoutViewModelService>().As <ICheckoutViewModelService>().InstancePerLifetimeScope(); //poll service builder.RegisterType <PollViewModelService>().As <IPollViewModelService>().InstancePerLifetimeScope(); //poll service builder.RegisterType <BoardsViewModelService>().As <IBoardsViewModelService>().InstancePerLifetimeScope(); //ReturnRequest service builder.RegisterType <ReturnRequestViewModelService>().As <IReturnRequestViewModelService>().InstancePerLifetimeScope(); //Newsletter service builder.RegisterType <NewsletterViewModelService>().As <INewsletterViewModelService>().InstancePerLifetimeScope(); //vendor service builder.RegisterType <VendorViewModelService>().As <IVendorViewModelService>().InstancePerLifetimeScope(); //course service builder.RegisterType <CourseViewModelService>().As <ICourseViewModelService>().InstancePerLifetimeScope(); }
public NinjectEngine(ITypeFinder typeFinder) : this(typeFinder, new ContainerManager()) { }
public void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { //builder.RegisterType<CustomService>().As<ICustomAttributeService>().InstancePerLifetimeScope(); //builder.RegisterType<CustomModelFactory>().As<ICustomModelFactory>().InstancePerLifetimeScope(); }
public MajidAutoMapperModule(ITypeFinder typeFinder) { _typeFinder = typeFinder; }
public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { //installation localization service builder.RegisterType<InstallationLocalizationService>().As<IInstallationLocalizationService>().InstancePerLifetimeScope(); }
/// <summary> /// Register services and interfaces /// </summary> /// <param name="builder">Container builder</param> /// <param name="typeFinder">Type finder</param> /// <param name="appSettings">App settings</param> public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, AppSettings appSettings) { builder.RegisterType <ShippingByWeightByTotalService>().As <IShippingByWeightByTotalService>().InstancePerLifetimeScope(); }
/// <summary> /// Register services and interfaces /// </summary> /// <param name="builder">Container builder</param> /// <param name="typeFinder">Type finder</param> /// <param name="config">Config</param> public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, NopConfig config) { builder.RegisterType <FacebookProviderAuthorizer>().As <IOAuthProviderFacebookAuthorizer>().InstancePerLifetimeScope(); }