Show / Hide Table of Contents

Interface UserDataStorage.IContainer

Implementation of this interface allows to customize behavior of GetUserData<T>(T) method.

Namespace: DotNext
Assembly: DotNext.dll
Syntax
public interface UserDataStorage.IContainer
Remarks

If runtime type of object passed to GetUserData<T>(T) method provides implementation of this interface then actual UserDataStorage depends on the Source implementation. It is recommended to implement this interface explicitly.

Properties

| Edit this page View Source

Source

Gets the actual source of user data for this object.

Declaration
object Source { get; }
Property Value
Type Description
object

The source of user data for this object.

Remarks

If this property returns this object then user data has to be attached to the object itself; otherwise, use the data attached to the returned object. Additionally, you can store user data explicitly in the backing field which is initialized with real user data storage using CreateStorage() method.

Methods

| Edit this page View Source

CreateStorage()

Creates a storage of user data that can be saved into field and returned via Source property.

Declaration
protected static object CreateStorage()
Returns
Type Description
object

The object representing storage for user data.

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾