Click or drag to resize

TenantIdentificationStrategyExtensionsIdentifyTenantT Method

Gets a typed tenant ID from a strategy or the default value for the type if identification fails.

Namespace:  Autofac.Multitenant
Assembly:  Autofac.Multitenant (in Autofac.Multitenant.dll) Version: 6.0.0+9a36082eb9b91dac82616d9efefa940b8c375948
Syntax
public static T IdentifyTenant<T>(
	this ITenantIdentificationStrategy strategy
)

Parameters

strategy
Type: Autofac.MultitenantITenantIdentificationStrategy
The ITenantIdentificationStrategy from which the tenant ID should be retrieved.

Type Parameters

T
The type of the tenant ID.

Return Value

Type: T
If tenant identification succeeds, the ID from strategy is converted to T and returned. If identification fails, the default value for T is returned.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ITenantIdentificationStrategy. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullException Thrown if strategy is .
See Also