Show / Hide Table of Contents

Class TenantBuilder<TTenant>

This class implements the tenant builder logic for tenant and store strategy.

Inheritance
System.Object
TenantBuilder<TTenant>
Namespace: Talegen.AspNetCore.Multitenant
Assembly: Talegen.AspNetCore.Multitenant.dll
Syntax
public class TenantBuilder<TTenant> : object where TTenant : class, ITenant, new()
Type Parameters
Name Description
TTenant

The type of the tenant.

Constructors

| Improve this Doc View Source

TenantBuilder(IServiceCollection)

Initializes a new instance of the TenantBuilder<TTenant> class.

Declaration
public TenantBuilder(IServiceCollection services)
Parameters
Type Name Description
IServiceCollection services

The services collection.

Methods

| Improve this Doc View Source

WithResolutionStrategy<TStrategy>(ServiceLifetime)

Implements the specific tenant resolution strategy.

Declaration
public TenantBuilder<TTenant> WithResolutionStrategy<TStrategy>(ServiceLifetime lifetime = null)
    where TStrategy : class, ITenantResolverStrategy
Parameters
Type Name Description
ServiceLifetime lifetime

The lifetime.

Returns
Type Description
TenantBuilder<TTenant>

Returns the tenant builder.

Type Parameters
Name Description
TStrategy

The type of the strategy.

| Improve this Doc View Source

WithSource<TSource>(ServiceLifetime)

Implements the specific tenant source for retrieval of non-cached tenant requests.

Declaration
public TenantBuilder<TTenant> WithSource<TSource>(ServiceLifetime lifetime = null)
    where TSource : class, ITenantSource<TTenant>
Parameters
Type Name Description
ServiceLifetime lifetime

The lifetime.

Returns
Type Description
TenantBuilder<TTenant>

Returns the tenant builder.

Type Parameters
Name Description
TSource

The type of the source.

| Improve this Doc View Source

WithStorageSettings<TStorageType>(TStorageType, ServiceLifetime)

Implements the specific tenant storage settings for a given type.

Declaration
public TenantBuilder<TTenant> WithStorageSettings<TStorageType>(TStorageType settings, ServiceLifetime lifetime = null)
Parameters
Type Name Description
TStorageType settings

The settings.

ServiceLifetime lifetime

The lifetime.

Returns
Type Description
TenantBuilder<TTenant>

Returns the tenant builder.

Type Parameters
Name Description
TStorageType

The type of the storage type to implement.

| Improve this Doc View Source

WithStore<TStore>(IStorageSettings, ServiceLifetime)

Implements the specific tenant store store method.

Declaration
public TenantBuilder<TTenant> WithStore<TStore>(IStorageSettings storageSettings = null, ServiceLifetime lifetime = null)
    where TStore : class, ITenantStore<TTenant>
Parameters
Type Name Description
IStorageSettings storageSettings

Contains an optional storage settings.

ServiceLifetime lifetime

The lifetime.

Returns
Type Description
TenantBuilder<TTenant>

Returns the tenant builder.

Type Parameters
Name Description
TStore

The type of the store.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright (c) Talegen, LLC. All rights reserved.