Click or drag to resize

RegistrationExtensionsCacheInSessionTLimit, TActivatorData, TSingleRegistrationStyle Method

Cache instances in the web session. This implies external ownership (disposal is not available.) All dependencies must also have external ownership.

Namespace:  Autofac.Integration.Web
Assembly:  Autofac.Integration.Web (in Autofac.Integration.Web.dll) Version: 6.0.0+0b24e3a20aaeba340141e7205a9b7643b9d6cc54
Syntax
public static IRegistrationBuilder<TLimit, TActivatorData, TSingleRegistrationStyle> CacheInSession<TLimit, TActivatorData, TSingleRegistrationStyle>(
	this IRegistrationBuilder<TLimit, TActivatorData, TSingleRegistrationStyle> registration
)
where TActivatorData : IConcreteActivatorData
where TSingleRegistrationStyle : SingleRegistrationStyle

Parameters

registration
Type: Autofac.BuilderIRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle
The registration to configure.

Type Parameters

TLimit
Registration limit type.
TActivatorData
Activator data type.
TSingleRegistrationStyle
Registration style.

Return Value

Type: IRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle
A registration builder allowing further configuration of the component.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRegistrationBuilderTLimit, TActivatorData, TSingleRegistrationStyle. 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).
Remarks
It is strongly recommended that components cached per-session do not take dependencies on other services.
See Also