public static IServiceDefintions AddSingleton(this IServiceDefintions services, Type serviceType, Func <INamedServiceProvider, object> serviceFactory, string name = null) { return(services.AddSingleton(serviceType, serviceType, serviceFactory, name)); }
public static IServiceDefintions AddSingleton(this IServiceDefintions services, Type serviceType, string name = null) { return(services.AddSingleton(serviceType, serviceType, null, name)); }
public static IServiceDefintions AddSingleton <TService>(this IServiceDefintions services, TService service, string name = null) where TService : class { return(services.AddSingleton(typeof(TService), service, name)); }
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)); }
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)); }
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)); }