Click or drag to resize

OperationContextTenantIdentificationStrategy Class

An ITenantIdentificationStrategy implementation that gets the tenant ID from a TenantIdentificationContextExtension attached to the current OperationContext.
Inheritance Hierarchy
SystemObject
  Autofac.Multitenant.WcfOperationContextTenantIdentificationStrategy

Namespace:  Autofac.Multitenant.Wcf
Assembly:  Autofac.Multitenant.Wcf (in Autofac.Multitenant.Wcf.dll) Version: 4.0.0-CI-234
Syntax
public class OperationContextTenantIdentificationStrategy : ITenantIdentificationStrategy

The OperationContextTenantIdentificationStrategy type exposes the following members.

Constructors
  NameDescription
Public methodOperationContextTenantIdentificationStrategy
Initializes a new instance of the OperationContextTenantIdentificationStrategy class
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodTryIdentifyTenant
Attempts to identify the tenant from the current operation context.
Top
Extension Methods
Remarks

Use this ITenantIdentificationStrategy if you are using the TenantIdentificationContextExtension as the mechanism for tracking which tenant a given operation is running under.

For example, you could use an IDispatchMessageInspector that gets the tenant ID from an incoming header and adds a TenantIdentificationContextExtension to the current OperationContext with the tenant ID value. Then you could register this provider as the mechanism for determining the tenant ID when resolving multitenant dependencies.

The TenantPropagationBehaviorTTenantId does exactly that - adds the tenant ID to outbound messages on the client and parses them on the service side. For a usage example, see TenantPropagationBehaviorTTenantId

See Also