• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ITypeFinder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ITypeFinder的典型用法代码示例。如果您正苦于以下问题:C# ITypeFinder类的具体用法?C# ITypeFinder怎么用?C# ITypeFinder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ITypeFinder类属于命名空间,在下文中一共展示了ITypeFinder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Register

        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();
        }
开发者ID:cjz9032,项目名称:ProjectWithNop,代码行数:35,代码来源:DependencyRegistrar.cs


示例2: Register

        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();
        }
开发者ID:shepherds126,项目名称:ShepherdsFramework,代码行数:32,代码来源:DependencyRegistrar.cs


示例3: Register

		public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, bool isActiveModule)
		{
			if (isActiveModule)
			{
				builder.RegisterType<PayPalExpressCheckoutFilter>().AsActionFilterFor<CheckoutController>(x => x.PaymentMethod()).InstancePerRequest();
			}
		}
开发者ID:boatengfrankenstein,项目名称:SmartStoreNET,代码行数:7,代码来源:DependencyRegistrar.cs


示例4: Register

        public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder)
        {
            builder.RegisterType<WebWorkContext>().As<IWorkContext>().InstancePerLifetimeScope();
               builder.RegisterType<CustomerService>().As<ICustomersService>().InstancePerLifetimeScope();

               //所有的controllers 注入
        }
开发者ID:shepherds126,项目名称:ShepherdsFramework,代码行数:7,代码来源:1439372017$dependencyregistrar.cs


示例5: Register

        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);
        }
开发者ID:TelWang,项目名称:WatermoonFramework,代码行数:28,代码来源:DependencyRegistrar.cs


示例6: ControllerMapper

        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);
                    }
                }
            }
        }
开发者ID:dpawatts,项目名称:zeus,代码行数:29,代码来源:ControllerMapper.cs


示例7: Register

        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();
        }
开发者ID:aquiladev,项目名称:MetalMastery,代码行数:35,代码来源:DependencyRegistrar.cs


示例8: Register

        public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder)
        {
            //we cache presentation models between requests

            //installation localization service
            builder.RegisterType<InstallationLocalizationService>().As<IInstallationLocalizationService>().InstancePerLifetimeScope();
        }
开发者ID:muharremha,项目名称:MuhFrame,代码行数:7,代码来源:DependencyRegistrar.cs


示例9: AppObjectReader

 public AppObjectReader(IReadObjectsCache readObjects, IApplicationObjectsRepository appObjectRepository,
     ITypeFinder typeFinder)
 {
     this.readObjects = readObjects;
     this.appObjectRepository = appObjectRepository;
     this.typeFinder = typeFinder;
 }
开发者ID:RobSmyth,项目名称:nserializer,代码行数:7,代码来源:AppObjectReader.cs


示例10: SetUp

        protected override void SetUp()
        {
            typeFinder = NewMock<ITypeFinder>();
            memberReader = NewMock<IMemberReader>();

            reader = new ValueTypeReader(memberReader, typeFinder);
        }
开发者ID:RobSmyth,项目名称:nserializer,代码行数:7,代码来源:ValueTypeReaderTests.cs


示例11: Register

        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();
        }
开发者ID:jiangjunjian,项目名称:baike,代码行数:26,代码来源:DependencyRegistrar.cs


示例12: Register

 public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, HeliosConfig config)
 {
     builder.RegisterType<PerRequestCacheManager>()
         .As<ICacheManager>()
         .Named<ICacheManager>("helios_cache_per_request")
         .InstancePerLifetimeScope();
 }
开发者ID:kelely,项目名称:Helios,代码行数:7,代码来源:DependencyRegistrar.cs


示例13: Register

 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();
 }
开发者ID:netsouls,项目名称:eCentral,代码行数:7,代码来源:DependencyRegistrar.cs


示例14: Register

        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();

        }
开发者ID:mobsoftware,项目名称:mob.core,代码行数:27,代码来源:BaseMobDependencyRegistrar.cs


示例15: Register

        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();
        }
开发者ID:Qixol,项目名称:Qixol.Promo.Nop.Plugin,代码行数:60,代码来源:DependencyRegistrar.cs


示例16: Register

 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>();
 }
开发者ID:esunxray,项目名称:Kooboo-CMS,代码行数:7,代码来源:AssemblyInitializer.cs


示例17: Register

		public virtual void Register(ContainerBuilder builder, ITypeFinder typeFinder, bool isActiveModule)
        {
			if (DataSettings.DatabaseIsInstalled())
			{
				builder.RegisterType<PreviewModeFilter>().AsResultFilterFor<PublicControllerBase>();
			}
        }
开发者ID:boatengfrankenstein,项目名称:SmartStoreNET,代码行数:7,代码来源:DependencyRegistrar.cs


示例18: Register

        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();
        }
开发者ID:nikolasx,项目名称:R2.Halo,代码行数:30,代码来源:DenpendencyRegistrar.cs


示例19: Register

        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();
        }
开发者ID:saturn72,项目名称:Saturn72.Plugins,代码行数:25,代码来源:DependencyRegistrar.cs


示例20: Register

 public void Register(ContainerBuilder builder, ITypeFinder typeFinder)
 {
     var webapiControllerAssemnblies = typeFinder.FindAssembliesWithTypeDerivatives<Saturn72ApiControllerBase>();
     builder.RegisterApiControllers(webapiControllerAssemnblies.ToArray());
     //var appDomainAssemblies = typeFinder.GetAssemblies().ToArray();
     //builder.RegisterApiControllers(appDomainAssemblies);
 }
开发者ID:saturn72,项目名称:Saturn72.Core,代码行数:7,代码来源:DependencyRegistrar.cs



注:本文中的ITypeFinder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ITypeHandler4类代码示例发布时间:2022-05-24
下一篇:
C# ITypeFactory类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap