当前位置: 首页>>代码示例>>C#>>正文


C# IServiceRegistry.RegisterAssembly方法代码示例

本文整理汇总了C#中IServiceRegistry.RegisterAssembly方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceRegistry.RegisterAssembly方法的具体用法?C# IServiceRegistry.RegisterAssembly怎么用?C# IServiceRegistry.RegisterAssembly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServiceRegistry的用法示例。


在下文中一共展示了IServiceRegistry.RegisterAssembly方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1:

        void ICompositionRoot.Compose(IServiceRegistry serviceRegistry)
        {
            CallCount++;
#if NETFX_CORE || WINDOWS_PHONE || IOS
            serviceRegistry.RegisterAssembly(typeof(SampleCompositionRoot).GetTypeInfo().Assembly);
#else
            serviceRegistry.RegisterAssembly(typeof(SampleCompositionRoot).Assembly);
#endif

        }
开发者ID:vitamink,项目名称:LightInject,代码行数:10,代码来源:SampleCompositionRoot.cs

示例2: Compose

        public void Compose(IServiceRegistry serviceRegistry)
        {
            serviceRegistry.Register(f => CreateNhSessionFactory(), new PerContainerLifetime());

            serviceRegistry.RegisterAssembly(typeof(NhPersonRepository).Assembly);

            serviceRegistry.RegisterAssembly(typeof(PersonService).Assembly);

            serviceRegistry.Register<UnitOfWorkInterceptor>();

            serviceRegistry.Intercept(sr => sr.ImplementingType != null && sr.ImplementingType.GetMethods().Any(m => m.IsDefined(typeof(UnitOfWorkAttribute), true)), f => f.GetInstance<UnitOfWorkInterceptor>());
        }
开发者ID:renatohh,项目名称:PhoneBook,代码行数:12,代码来源:PhoneBookCompositionRoot.cs

示例3: Compose

        public void Compose(IServiceRegistry serviceRegistry)
        {
            serviceRegistry.RegisterAssembly(typeof (ITerrain<>).Assembly,
                                             (_, t) => t.IsTerrain());

            serviceRegistry.RegisterAssembly(typeof (ITerrainFactory<>).Assembly,
                                             () => new PerContainerLifetime(),
                                             (_, t) => t.IsTerrainFactory());

            serviceRegistry.Register<ISet<ITerrain>>(_ => new HashSet<ITerrain>(new TerrainEqualityComparer()),
                                                     new PerContainerLifetime());

            serviceRegistry.Register<ITerrainLayer, SimpleFixedTerrainLayer>(new PerContainerLifetime());
        }
开发者ID:SPDiswal,项目名称:ExtenCiv,代码行数:14,代码来源:TerrainsCompositionRoot.cs

示例4: Compose

        public void Compose(IServiceRegistry serviceRegistry)
        {
            serviceRegistry.RegisterAssembly(typeof (ICity<>).Assembly,
                                             (_, t) => t.IsCity());

            serviceRegistry.RegisterAssembly(typeof (ICityFactory<>).Assembly,
                                             () => new PerContainerLifetime(),
                                             (_, t) => t.IsCityFactory());

            serviceRegistry.Register<ISet<ICity>>(_ => new HashSet<ICity>(new CityEqualityComparer()),
                                                  new PerContainerLifetime());

            serviceRegistry.Register<ICityLayer, SimpleFixedCityLayer>(new PerContainerLifetime());
        }
开发者ID:SPDiswal,项目名称:ExtenCiv,代码行数:14,代码来源:CitiesCompositionRoot.cs

示例5: Compose

        public void Compose(IServiceRegistry serviceRegistry)
        {
            serviceRegistry.RegisterAssembly(typeof (IUnit<>).Assembly,
                                             (_, t) => t.IsUnit());

            serviceRegistry.RegisterAssembly(typeof (IUnitFactory<>).Assembly,
                                             () => new PerContainerLifetime(),
                                             (_, t) => t.IsUnitFactory());

            serviceRegistry.RegisterAssembly(typeof(IProductionProject).Assembly,
                                             () => new PerContainerLifetime(),
                                             (_, t) => t.IsProductionProject());

            serviceRegistry.Register<ISet<IUnit>>(_ => new HashSet<IUnit>(new UnitEqualityComparer()),
                                                  new PerContainerLifetime());

            serviceRegistry.Register<IUnitLayer, SimpleFixedUnitLayer>(new PerContainerLifetime());
        }
开发者ID:SPDiswal,项目名称:ExtenCiv,代码行数:18,代码来源:UnitsCompositionRoot.cs

示例6: RegisterServices

        public static void RegisterServices(IServiceRegistry serviceRegistry)
        {
            Business.ServiceConfig.RegisterServices(serviceRegistry);

            var assembly = typeof (ServiceConfig).Assembly;
            var webHandlerType = typeof (IWebHandler);
            var mapperType = typeof (IMapper);

            serviceRegistry.RegisterAssembly(
                assembly,
                () => new PerRequestLifeTime(),
                (serviceType, implementingType) => webHandlerType.IsAssignableFrom(serviceType));

            serviceRegistry.RegisterAssembly(
                assembly,
                () => new PerRequestLifeTime(),
                (serviceType, implementingType) => mapperType.IsAssignableFrom(serviceType));
        }
开发者ID:raskhodchikov,项目名称:room-planner,代码行数:18,代码来源:ServiceConfig.cs

示例7: Compose

        public void Compose(IServiceRegistry serviceRegistry)
        {
            serviceRegistry.RegisterAssembly("DrawPub*.dll");
            serviceRegistry.Register<IInterceptor, LogInterceptor>("LogInterceptor");

            serviceRegistry.Intercept(sr => sr.ServiceType == typeof(IUserAppplicationService), DefineProxyType);
            serviceRegistry.Intercept(sr => sr.ServiceType == typeof(IUserRepository), DefineProxyType);
            serviceRegistry.Intercept(sr => sr.ServiceType == typeof(IConnectionProvider), DefineProxyType);
        }
开发者ID:GNewsCo,项目名称:DrawPub,代码行数:9,代码来源:CompositionRoot.cs

示例8: Compose

 public void Compose(IServiceRegistry serviceRegistry)
 {
     serviceRegistry.RegisterAssembly(typeof (EntityContext).Assembly);
 }
开发者ID:geirsagberg,项目名称:Reference,代码行数:4,代码来源:DataModule.cs

示例9: ConfigureContainer

 private void ConfigureContainer(IServiceRegistry registry)
 {
     registry.RegisterInstance<IFodyLogger>(this);
     registry.RegisterInstance<ModuleWeaver>(this);
     registry.RegisterInstance<ModuleDefinition>(this.ModuleDefinition);
     registry.RegisterAssembly(GetType().Assembly
         , (serviceType, implementingType) => typeof(IModuleProcessor).IsAssignableFrom(implementingType));
 }
开发者ID:brainoffline,项目名称:Commander.Fody,代码行数:8,代码来源:ModuleWeaver.cs

示例10: Compose

 public void Compose(IServiceRegistry serviceRegistry)
 {
     serviceRegistry.RegisterAssembly(typeof (PersonLogic).Assembly);
 }
开发者ID:geirsagberg,项目名称:Reference,代码行数:4,代码来源:LogicModule.cs

示例11:

 void ICompositionRoot.Compose(IServiceRegistry serviceRegistry)
 {
     serviceRegistry.RegisterAssembly("LightInject.Wcf.SampleLibrary.Implementation.dll");
 }
开发者ID:vitamink,项目名称:LightInject,代码行数:4,代码来源:CompositionRoot.cs

示例12: Compose

 public void Compose(IServiceRegistry serviceRegistry)
 {
     CallCount++;
     serviceRegistry.RegisterAssembly(typeof(SampleCompositionRoot).Assembly);
 }
开发者ID:hendryten,项目名称:LightInject,代码行数:5,代码来源:SampleCompositionRoot.cs


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