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