Class AmorphousTypedRow
Represents a type-safe row of data 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 rows store data in instance fields, providing better performance and schema definition compile-time checking than DynamicRows at the expense of inability to define schema at runtime
Implements
Inherited Members
Namespace: NFX.DataAccess.CRUD
Assembly: NFX.dll
Syntax
[Serializable]
public abstract class AmorphousTypedRow : TypedRow, IConfigurable, IConfigurationPersistent, IEquatable<Row>, IEnumerable<object>, IEnumerable, IValidatable, IJSONWritable, IAmorphousData
Constructors
AmorphousTypedRow()
Declaration
protected AmorphousTypedRow()
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 row 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 row 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 |