示例#1
0
 /// <summary>
 /// Registers the service with the specified life style.
 /// </summary>
 /// <typeparam name="TConcrete">The type of the concrete implementation.</typeparam>
 /// <param name="lifeStyle">The life style.</param>
 /// <returns></returns>
 public IContainer Register <TConcrete>(LifeStyles lifeStyle) where TConcrete : class
 {
     _container.Register <TConcrete>(GetLifeStyle(lifeStyle));
     return(this);
 }
示例#2
0
 /// <summary>
 /// Registers the implementation type as a fall back if no other registration has been made
 /// </summary>
 /// <param name="serviceType">Type of the service.</param>
 /// <param name="implementationType">Type of the implementation.</param>
 /// <param name="lifestyle">The lifestyle.</param>
 /// <returns></returns>
 public IContainer RegisterConditional(Type serviceType, Type implementationType, LifeStyles lifestyle)
 {
     _container.RegisterConditional(serviceType, implementationType, GetLifeStyle(lifestyle), c => !c.Handled);
     return(this);
 }
 /// <summary>
 /// Registers the specified open generic service type.
 /// </summary>
 /// <param name="openGenericServiceType">Type of the open generic service.</param>
 /// <param name="implementationTypes">The implementation types.</param>
 /// <param name="lifeStyle">The life style.</param>
 /// <returns></returns>
 public IContainer Register(Type openGenericServiceType, IEnumerable <Type> implementationTypes, LifeStyles lifeStyle)
 {
     _container.Register(openGenericServiceType, implementationTypes, GetLifeStyle(lifeStyle));
     return(this);
 }
示例#4
0
 /// <summary>
 /// Registers the service with the specified life style.
 /// </summary>
 /// <typeparam name="TService">The type of the service.</typeparam>
 /// <param name="instanceCreator">The instance creator.</param>
 /// <param name="lifeStyle">The life style.</param>
 /// <returns></returns>
 public IContainer Register <TService>(Func <TService> instanceCreator, LifeStyles lifeStyle)
     where TService : class
 {
     _container.Register(instanceCreator, GetLifeStyle(lifeStyle));
     return(this);
 }
示例#5
0
 /// <summary>
 ///  Ensures that the supplied TDecorator decorator is returned and cached with the given lifestyle
 /// </summary>
 /// <typeparam name="TService">The type of the service.</typeparam>
 /// <typeparam name="TDecorator">The type of the decorator.</typeparam>
 /// <param name="lifestyle">The lifestyle.</param>
 /// <returns></returns>
 public IContainer RegisterDecorator <TService, TDecorator>(LifeStyles lifestyle)
 {
     _container.RegisterDecorator <TService, TDecorator>(GetLifeStyle(lifestyle));
     return(this);
 }