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
Syntax public static IRegistrationBuilder<TLimit, TActivatorData, TSingleRegistrationStyle> CacheInSession<TLimit, TActivatorData, TSingleRegistrationStyle>(
this IRegistrationBuilder<TLimit, TActivatorData, TSingleRegistrationStyle> registration
)
where TActivatorData : IConcreteActivatorData
where TSingleRegistrationStyle : SingleRegistrationStyle
<ExtensionAttribute>
Public Shared Function CacheInSession(Of TLimit, TActivatorData As IConcreteActivatorData, TSingleRegistrationStyle As SingleRegistrationStyle) (
registration As IRegistrationBuilder(Of TLimit, TActivatorData, TSingleRegistrationStyle)
) As IRegistrationBuilder(Of TLimit, TActivatorData, TSingleRegistrationStyle)
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,
TSingleRegistrationStyleA 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