internal static void AddInternalServiceDefintions(this IServiceDefintions services) { if (!services.Contains <IServiceProvider>()) { services.AddScoped(i => i); } if (!services.Contains <IServiceScopeFactory>()) { services.AddScoped <IServiceScopeFactory>(i => new ServiceScopeFactory(i)); } if (!services.Contains <IDelegateServiceDefintionHandler, PropertyInjector>()) { services.AddScoped <IDelegateServiceDefintionHandler, PropertyInjector>(i => new PropertyInjector()); } }
public static IServiceDefintions AddScoped <TService>(this IServiceDefintions services, Func <INamedServiceProvider, TService> implementationFactory, string name = null) where TService : class { return(services.AddScoped(typeof(TService), typeof(TService), implementationFactory, name)); }
public static IServiceDefintions AddScoped <TService>(this IServiceDefintions services, string name = null) where TService : class { return(services.AddScoped(typeof(TService), typeof(TService), null, name)); }
public static IServiceDefintions AddScoped <TService, TImplementation>(this IServiceDefintions services, string name = null) where TService : class where TImplementation : TService { return(services.AddScoped(typeof(TService), typeof(TImplementation), null, name)); }
public static IServiceDefintions AddScoped(this IServiceDefintions services, Type serviceType, Func <INamedServiceProvider, object> serviceFactory, string name = null) { return(services.AddScoped(serviceType, serviceType, serviceFactory, name)); }
public static IServiceDefintions AddScoped(this IServiceDefintions services, Type serviceType, string name = null) { return(services.AddScoped(serviceType, serviceType, null, name)); }