Click or drag to resize

TenantPropagationMessageInspectorTTenantId Class

Message inspector that helps in passing the tenant ID from a WCF client to the respective service.
Inheritance Hierarchy

Namespace:  Autofac.Multitenant.Wcf
Assembly:  Autofac.Multitenant.Wcf (in Autofac.Multitenant.Wcf.dll) Version: 4.0.0-CI-234
public class TenantPropagationMessageInspector<TTenantId> : IClientMessageInspector, 

Type Parameters

The type of the tenant ID to propagate. Must be nullable and serializable so it can be added to a message header.

The TenantPropagationMessageInspectorTTenantId type exposes the following members.

Public methodTenantPropagationMessageInspectorTTenantId
Initializes a new instance of the TenantPropagationMessageInspectorTTenantId class.
Public propertyTenantIdentificationStrategy
Gets the strategy used for identifying the current tenant.
Public methodAfterReceiveReply
Enables inspection or modification of a message after a reply message is received but prior to passing it back to the client application.
Public methodAfterReceiveRequest
Inspects inbound message headers and adds an TenantIdentificationContextExtension to the current operation context with the tenant ID.
Public methodBeforeSendReply
Called after the operation has returned but before the reply message is sent.
Public methodBeforeSendRequest
Adds the tenant ID to the outbound message headers.
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.)
Protected fieldStatic memberTenantHeaderName
Name of the header that gets added to messages and carries the tenant ID.
Protected fieldStatic memberTenantHeaderNamespace
Namespace of the header that gets added to messages and carries tenant information.

Use this in conjunction with the TenantPropagationBehaviorTTenantId to automatically get the tenant ID on the WCF client end, add the ID to a header on the outbound message, and have the tenant ID read from headers on the service side and added to the operation context in an TenantIdentificationContextExtension. This allows you, on the service side, to use the OperationContextTenantIdentificationStrategy as your registered ITenantIdentificationStrategy.

For a usage example, see TenantPropagationBehaviorTTenantId.

See Also