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 SourceSource
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 SourceCreateStorage()
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. |