Class HybridAccessorBase<T>
Provides a base class for hybrid accessors.
Inheritance
object
Namespace: Umbraco.Cms.Core
Assembly: Umbraco.Core.dll
Syntax
public abstract class HybridAccessorBase<T> where T : class
Type Parameters
| Name | Description |
|---|---|
| T | The type of the accessed object. |
Remarks
Hybrid accessors store the accessed object in HttpContext if they can, otherwise they rely on the logical call context, to maintain an ambient object that flows with async.
Constructors
View SourceHybridAccessorBase(IRequestCache)
Initializes a new instance of the HybridAccessorBase<T> class.
Declaration
protected HybridAccessorBase(IRequestCache requestCache)
Parameters
| Type | Name | Description |
|---|---|---|
| IRequestCache | requestCache | The request cache for storing the value in the HTTP context. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The request cache is null. |
Properties
View SourceItemKey
Gets the unique key used to store the value in the request cache.
Declaration
protected string ItemKey { get; }
Property Value
| Type | Description |
|---|---|
| string |
Value
Gets or sets the current value, storing it either in the HTTP context or the ambient context.
Declaration
protected T? Value { get; set; }
Property Value
| Type | Description |
|---|---|
| T |