Exemple #1
0
 public static IServiceDefintions AddSingleton(this IServiceDefintions services, Type serviceType, Func <INamedServiceProvider, object> serviceFactory, string name = null)
 {
     return(services.AddSingleton(serviceType, serviceType, serviceFactory, name));
 }
Exemple #2
0
 public static IServiceDefintions AddSingleton(this IServiceDefintions services, Type serviceType, string name = null)
 {
     return(services.AddSingleton(serviceType, serviceType, null, name));
 }
Exemple #3
0
 public static IServiceDefintions AddSingleton <TService>(this IServiceDefintions services, TService service, string name = null) where TService : class
 {
     return(services.AddSingleton(typeof(TService), service, name));
 }
Exemple #4
0
 public static IServiceDefintions AddSingleton <TService>(this IServiceDefintions services, Func <INamedServiceProvider, TService> serviceFactory, string name = null) where TService : class
 {
     return(services.AddSingleton(typeof(TService), typeof(TService), serviceFactory, name));
 }
Exemple #5
0
 public static IServiceDefintions AddSingleton <TService, TImplementation>(this IServiceDefintions services,
                                                                           Func <INamedServiceProvider, TImplementation> serviceFactory, string name = null) where TService : class where TImplementation : TService
 {
     return(services.AddSingleton(typeof(TService), typeof(TImplementation), i => serviceFactory(i), name));
 }
Exemple #6
0
 public static IServiceDefintions AddSingleton <TService, TImplementation>(this IServiceDefintions services, string name = null)
     where TService : class where TImplementation : TService
 {
     return(services.AddSingleton(typeof(TService), typeof(TImplementation), null, name));
 }