Class Transformer<T>
- Namespace
- Open.Database.Extensions.Core
- Assembly
- Open.Database.Extensions.Core.dll
Utility of transforming retrieved data into models matching the type parameter provided.
public class Transformer<T> where T : new()
Type Parameters
TThe type of the model to create from the data.
- Inheritance
-
Transformer<T>
- Inherited Members
Remarks
The mapping is a compiled, cached Open.Database.Extensions.Core.RowPlan<T>: constructing a transformer and applying it to a result no longer rebuilds lookups or property setters per query.
Constructors
- Transformer(IEnumerable<KeyValuePair<string, string?>>?)
Constructs a transformer using the optional field overrides.
Fields
- LocalPool
Buffers for transforming.
- MaxArrayBuffer
Maximum number of arrays to hold in the local array pool per bucket. May also define how many records are pre buffered before transforming.
Properties
- ColumnNames
The column names.
- PropertyNames
The property names.
- Type
The type of
T.
Methods
- AsDequeueingEnumerable(QueryResult<Queue<object?[]>>)
Dequeues the results and transforms each one by one during enumeration.
- AsDequeueingEnumerable(QueryResult<Queue<object[]>>, ArrayPool<object>, bool)
Dequeues the results and transforms each one by one during enumeration.
- Create()
Static utility for creating a Transformer
T.
- Create(params IEnumerable<KeyValuePair<string, string?>>?)
Static utility for creating a Transformer
T.
- Create(params IEnumerable<(string Field, string? Column)>?)
Static utility for creating a Transformer
T.
- Results(DataTable, bool)
Processes the data from the data table into a queue. Then dequeues the results and transforms each one by one during enumeration.