Class AmorphousTypedDoc
Represents a type-safe data document when schema is known at compile-time that also implements IAmorphousData interface that allows this row to store "extra" data that does not comply with the current schema. Typed docs store data in instance fields, providing better performance and schema definition compile-time checking than DynamicDocs at the expense of inability to define schema at runtime
Implements
Inherited Members
Namespace: Azos.Data
Assembly: Azos.dll
Syntax
[Serializable]
public abstract class AmorphousTypedDoc : TypedDoc, IConfigurable, IConfigurationPersistent, IEquatable<Doc>, IEnumerable<object>, IEnumerable, IValidatable, IJSONWritable, IAmorphousData
Constructors
AmorphousTypedDoc()
Declaration
protected AmorphousTypedDoc()
Properties
AmorphousData
Returns data that does not comply with known schema (dynamic data). The field names are NOT case-sensitive
Declaration
public IDictionary<string, object> AmorphousData { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.Object> |
AmorphousDataEnabled
True by default for rows
Declaration
public virtual bool AmorphousDataEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AfterLoad(String)
Invoked to allow the doc to hydrate its fields/state from AmorphousData bag. For example, this may be used to reconstruct some temporary object state that is not stored as a part of established business schema. The operation is performed per particular targetName (name of physical backend). Simply put, this method allows business code to "specify what to do after object gets loaded from THE PARTICULAR TARGET backend store". An example: suppose current MongoDB collection stores 3 fields for name, and we want to collapse First/Last/Middle name fields into one field. If we change rowschema then it will only contain 1 field which is not present in the database, however those 'older' fields will get populated into AmorphousData giving us an option to merge older 3 fields into 1 within AfterLoad() implementation
Declaration
public virtual void AfterLoad(string targetName)
Parameters
Type | Name | Description |
---|---|---|
System.String | targetName |
BeforeSave(String)
Invoked to allow the doc to transform its state into AmorphousData bag. For example, this may be usefull to store extra data that is not a part of established business schema. The operation is performed per particular targetName (name of physical backend). Simply put, this method allows business code to "specify what to do before object gets saved in THE PARTICULAR TARGET backend store"
Declaration
public virtual void BeforeSave(string targetName)
Parameters
Type | Name | Description |
---|---|---|
System.String | targetName |