Search Results for

    Show / Hide Table of Contents

    Class RowSchemaBase<TRowSchema, TSchemaNode>

    Abstract base class that contains information about the columns in a dataflow row and their data types, or the columns of an external data source. This is useful for working with column names and their types, e.g. for implementing column mapping directly, or for building higher level constructs such as TypeColumnCopier<TFrom, TTo>.

    Use TypeRowSchema when you have access to the required .NET CLR type, since it can populate the instance automatically from the type. Otherwise use FlatRowSchema and specify columns explicitly.

    Columns can be searched for via several Get* methods. They can also be accessed as a flat list via the SchemaNodeList property, and as a hierarchical tree via the SchemaNodeRoot property. Note that the root node of the tree is not included in the SchemaNodeList list.

    The hierarchical tree and flat list include all descendant fields and properties, down to individual columns, e.g. int, byte[], SqlBinary etc., optionally grouped in column schemas (i.e. a struct in a field which creates a new parent node in the tree). Derived classes that has columns without any hierarchy (like FlatRowSchema) must still populate the tree with a root node and with all columns as direct children of the root.

    See Dataflow Columns for details.

    Inheritance
    Object
    RowSchemaBase<TRowSchema, TSchemaNode>
    FlatRowSchema
    TypeRowSchema
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public abstract class RowSchemaBase<TRowSchema, TSchemaNode>
        where TRowSchema : RowSchemaBase<TRowSchema, TSchemaNode> where TSchemaNode : SchemaNode
    Type Parameters
    Name Description
    TRowSchema

    The type of the derived class.

    TSchemaNode

    The type of the schema node class.

    Properties

    ColumnCount

    Gets the column count of the row. This can be less than the total number of TSchemaNodes, since it excludes the column schemas themselves and any unsupported column types.

    Declaration
    public int ColumnCount { get; }
    Property Value
    Type Description
    Int32

    SchemaNodeList

    Gets the SchemaNodes for the whole row as a read-only flat list. Note that this includes both columns and column schemas, but not the root node of the hierarchical tree.

    Items are returned in a well defined order controlled by OrderAttribute. Columns in a column schema are kept together as a group, are ordered according to the OrderAttribute rules within the group, with the whole group placed in the overall order where their parent member is placed (i.e. change the position of the whole group by changing the position of the parent member).

    Declaration
    public IReadOnlyList<TSchemaNode> SchemaNodeList { get; }
    Property Value
    Type Description
    IReadOnlyList<TSchemaNode>

    SchemaNodeRoot

    Gets the root of the SchemaNode hierarchical tree for the whole row.

    For TypeRowSchema, the root corresponds to the row class. Note that the descendants include both columns and column schemas. The children of each node in the tree are ordered according to the OrderAttribute rules.

    For FlatRowSchema, the root is just a container for the its child columns, which have the same order as their creation order.

    Also note that the root node is not included in the SchemaNodeList list.

    Declaration
    public TSchemaNode SchemaNodeRoot { get; }
    Property Value
    Type Description
    TSchemaNode

    Methods

    GetSchemaNode(String)

    Gets a single SchemaNode given its name.

    Declaration
    public TSchemaNode GetSchemaNode(string schemaNodeName)
    Parameters
    Type Name Description
    String schemaNodeName

    Name of the SchemaNode. Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match.

    Column schema names can optionally be omitted from the left, as long as the specified name is unique among all columns in the row. E.g., assuming "FirstName" is unique, the following can all return the same instance:

    • "Person.Name.FirstName"
    • "Name.FirstName"
    • "FirstName"

    Returns
    Type Description
    TSchemaNode

    The SchemaNode, or null if not found.

    Exceptions
    Type Condition
    ArgumentNullException

    schemaNodeName

    InvalidOperationException

    Found more than one member match in type.

    GetSchemaNodesBySuffix()

    Gets all SchemaNodes by name suffix.

    Declaration
    public IEnumerable<IEnumerable<TSchemaNode>> GetSchemaNodesBySuffix()
    Returns
    Type Description
    IEnumerable<IEnumerable<TSchemaNode>>

    All SchemaNodes. Each inner IEnumerable contains all the SchemaNode that have a particular (ordinal case insensitive) suffix, which will be more than one if the column name suffix is not unique.

    When using the result, note that SchemaNode names should normally match as ordinal case insensitive, but give precedence to ordinal case sensitive over ordinal case insensitive.

    The outer IEnumerable enumerates the different (ordinal case insensitive) name suffixes, or an empty IEnumerable if there are no SchemaNodes.

    GetSchemaNodesBySuffix(String)

    Gets all SchemaNodes that matches the given name suffix.

    Declaration
    public IEnumerable<TSchemaNode> GetSchemaNodesBySuffix(string schemaNodeSuffix)
    Parameters
    Type Name Description
    String schemaNodeSuffix

    The column suffix, i.e. the right-most part of the (potentially) dot-separated name. Column name matching is ordinal case insensitive, but a case sensitive match takes precedence over a case insensitive match.

    Returns
    Type Description
    IEnumerable<TSchemaNode>

    The matching SchemaNodes, or an empty IEnumerable if no matches found.

    When using the result, note that SchemaNode names should normally match as ordinal case insensitive, but give precedence to ordinal case sensitive over ordinal case insensitive.

    Exceptions
    Type Condition
    ArgumentNullException

    schemaNodeSuffix

    ToString()

    Returns a string that represents this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()

    See Also

    TypeRowSchema
    FlatRowSchema
    TypeSchemaNode
    SchemaNode
    In This Article
    Back to top Copyright © 2023 Envobi Ltd