Beispiel #1
0
        public static void AddTenantScoped(this IServiceCollection serviceCollection,
                                           ITenant tenant,
                                           Type serviceType,
                                           object instance)
        {
            var tenantScopedServiceDescriptor = new TenantScopedServiceDescriptor(tenant, serviceType, instance);

            serviceCollection.Add(tenantScopedServiceDescriptor);
        }
Beispiel #2
0
        public static void AddTenantScoped(this IServiceCollection serviceCollection,
                                           ITenant tenant,
                                           Type serviceType,
                                           Func <IServiceProvider, object> factory,
                                           ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
        {
            var tenantScopedServiceDescriptor = new TenantScopedServiceDescriptor(tenant, serviceType, factory, serviceLifetime);

            serviceCollection.Add(tenantScopedServiceDescriptor);
        }
Beispiel #3
0
        public static void AddTenantScoped(this IServiceCollection serviceCollection,
                                           ITenant tenant,
                                           Type serviceType,
                                           Type implementationType,
                                           ServiceLifetime serviceLifetime = ServiceLifetime.Scoped)
        {
            var tenantScopedServiceDescriptor = new TenantScopedServiceDescriptor(tenant, serviceType, implementationType, serviceLifetime);

            serviceCollection.Add(tenantScopedServiceDescriptor);
        }