本文整理汇总了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
}
示例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>());
}
示例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());
}
示例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());
}
示例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());
}
示例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));
}
示例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);
}
示例8: Compose
public void Compose(IServiceRegistry serviceRegistry)
{
serviceRegistry.RegisterAssembly(typeof (EntityContext).Assembly);
}
示例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));
}
示例10: Compose
public void Compose(IServiceRegistry serviceRegistry)
{
serviceRegistry.RegisterAssembly(typeof (PersonLogic).Assembly);
}
示例11:
void ICompositionRoot.Compose(IServiceRegistry serviceRegistry)
{
serviceRegistry.RegisterAssembly("LightInject.Wcf.SampleLibrary.Implementation.dll");
}
示例12: Compose
public void Compose(IServiceRegistry serviceRegistry)
{
CallCount++;
serviceRegistry.RegisterAssembly(typeof(SampleCompositionRoot).Assembly);
}