src/Tiantianquan.Common/Tiantianquan.Common/Dependency/ObjectContainer.cs
/// <summary>Register a implementer type as a service implementation.
/// </summary>
/// <typeparam name="TService">The service type.</typeparam>
/// <typeparam name="TImplementer">The implementer type.</typeparam>
/// <param name="serviceName">The service name.</param>
/// <param name="life">The life cycle of the implementer type.</param>
Register a implementer type as a service implementation.
Register a implementer type as a service implementation .
public static void Register<TService, TImplementer>(string serviceName = null, LifeStyle life = LifeStyle.Singleton)
            where TService : class
            where TImplementer : class, TService
        {
            Current.Register<TService, TImplementer>(serviceName, life);
        }
public static void Register < TService , TImplementer > ( string serviceName = null , LifeStyle life = LifeStyle . Singleton ) where TService : class where TImplementer : class , TService { Current . Register < TService , TImplementer > ( serviceName , life ) ; }
Register a implementer type as a service implementation.
Register a implementer type as a service implementation .
serviceName
string
The service name.
The service name .
life
LifeStyle
The life cycle of the implementer type.
The life cycle of the implementer type .
typeparam
The service type.
The service type .
typeparam
The implementer type.
The implementer type .