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.Mvc
Assembly:  Autofac.Integration.Mvc (in Autofac.Integration.Mvc.dll) Version: 6.0.0+106fe194fc419c09f32d39119967f68798cc6895
public static IRegistrationBuilder<TLimit, TActivatorData, TSingleRegistrationStyle> CacheInSession<TLimit, TActivatorData, TSingleRegistrationStyle>(
	this IRegistrationBuilder<TLimit, TActivatorData, TSingleRegistrationStyle> registration
where TActivatorData : IConcreteActivatorData
where TSingleRegistrationStyle : SingleRegistrationStyle


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

Type Parameters

Registration limit type.
Activator data type.
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).
It is strongly recommended that components cached per-session do not take dependencies on other services.
See Also