Exemplo n.º 1
0
 public static IServiceDefintions AddSingleton(this IServiceDefintions services, Type serviceType, object instance, string name = null)
 {
     return(services.AddInstance(Lifetime.Singleton, serviceType, serviceType, instance, name));
 }
Exemplo n.º 2
0
 public static IServiceDefintions AddSingleton <TService, TImplementation>(this IServiceDefintions services,
                                                                           TImplementation implementation, string name = null) where TService : class where TImplementation : TService
 {
     return(services.AddInstance(Lifetime.Singleton, typeof(TService), typeof(TImplementation), implementation, name));
 }