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 bool Contains <TService, TImplementation>(this IServiceDefintions services) where TService : class where TImplementation : TService { return(services.Contains(typeof(TService), typeof(TImplementation))); }
public static bool Contains <TService>(this IServiceDefintions services) where TService : class { return(services.Contains(typeof(TService))); }