Exemplo n.º 1
0
 /// <summary>
 /// Register service with service type and implement instance.
 /// </summary>
 /// <param name="services">Service definition collection.</param>
 /// <param name="serviceType">Service type.</param>
 /// <param name="instance">Implement instance.</param>
 public static IServiceDefinitionCollection RegisterService(this IServiceDefinitionCollection services, Type serviceType, object instance)
 {
     return(services.RegisterService(serviceType, instance, ServiceLifeTime.Scope));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Register service with service type and implement type.
 /// </summary>
 /// <typeparam name="TServiceType">Service type.</typeparam>
 /// <typeparam name="TImplementType">Implement type.</typeparam>
 /// <param name="services">Service definition collection.</param>
 /// <param name="lifeTime">Service life time.</param>
 public static IServiceDefinitionCollection RegisterService <TServiceType, TImplementType>(this IServiceDefinitionCollection services, ServiceLifeTime lifeTime)
 {
     return(services.RegisterService(typeof(TServiceType), typeof(TImplementType), lifeTime));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Register service with service type and implement instance.
 /// </summary>
 /// <typeparam name="TServiceType">Service type.</typeparam>
 /// <param name="services">Service definition collection.</param>
 /// <param name="instance">Implement instance.</param>
 public static IServiceDefinitionCollection RegisterService <TServiceType>(this IServiceDefinitionCollection services, object instance, ServiceLifeTime lifeTime)
 {
     return(services.RegisterService(typeof(TServiceType), instance, lifeTime));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Register service with service type and implement factory.
 /// </summary>
 /// <typeparam name="TServiceType">Service type.</typeparam>
 /// <param name="services">Service definition collection.</param>
 /// <param name="factory">Implement factory.</param>
 /// <param name="lifeTime">Service life time.</param>
 public static IServiceDefinitionCollection RegisterService <TServiceType>(this IServiceDefinitionCollection services, Func <object> factory, ServiceLifeTime lifeTime)
 {
     return(services.RegisterService(typeof(TServiceType), factory, lifeTime));
 }