Search Results for

    Show / Hide Table of Contents

    Class RowComparer<TLeft, TRight>

    Creates a Comparison<TLeft, TRight> (available in Comparison) for comparing two rows of potentially different types, using high performance generated code. Use RowComparer<T> instead if the rows have the same type.

    Also see Compare Dataflow Columns.

    Inheritance
    Object
    RowComparer<TLeft, TRight>
    Implements
    IRowComparerCommand<TLeft, TRight>
    IFluentInterface
    Namespace: actionETL
    Assembly: actionETL.dll
    Syntax
    public sealed class RowComparer<TLeft, TRight> : IRowComparerCommand<TLeft, TRight>, IFluentInterface where TLeft : class where TRight : class
    Type Parameters
    Name Description
    TLeft

    The type of the left row.

    TRight

    The type of the right row.

    Constructors

    RowComparer(Action<IRowComparerCommand<TLeft, TRight>>)

    Initializes a new instance of the RowComparer<TLeft, TRight> class with a row comparer command action, which specifies how to compare two rows of potentially different types. On return, Comparison will hold the generated row comparer, or null if a comparison could not be created.

    Also see Compare Dataflow Columns.

    Declaration
    public RowComparer(Action<IRowComparerCommand<TLeft, TRight>> rowComparerCommandAction)
    Parameters
    Type Name Description
    Action<IRowComparerCommand<TLeft, TRight>> rowComparerCommandAction

    The row comparer command action, which specifies which column pair(s) to include in the comparison.

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

    Exceptions
    Type Condition
    ArgumentNullException

    rowComparerCommandAction

    Properties

    Comparison

    Gets the comparison that compares two rows, or null if it could not be created.

    Declaration
    public Comparison<TLeft, TRight> Comparison { get; }
    Property Value
    Type Description
    Comparison<TLeft, TRight>

    Methods

    ToString()

    Returns a String that represents this instance.

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

    Explicit Interface Implementations

    IRowComparerCommand<TLeft, TRight>.Asc(String)

    Includes the specified column pair in the comparison, with values evaluated in ascending order.

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

    Columns must have identical types (although nullability can differ). If this is not the case, use an overload that specifies the comparison explicitly.

    While string columns use case sensitive comparisons with the current culture, do instead use overloads that specifies a StringComparer explicitly.

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Asc(string columnName)
    Parameters
    Type Name Description
    String columnName

    Name of the left and right columns.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.
    • RowComparer: columns have different types.
    • RowComparer: column type has no CompareTo() method.

    IRowComparerCommand<TLeft, TRight>.Asc(String, String)

    Includes the specified column pair in the comparison, with values evaluated in ascending order.

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

    Columns must have identical types (although nullability can differ). If this is not the case, use an overload that specifies the comparison explicitly.

    While string columns use case sensitive comparisons with the current culture, do instead use overloads that specifies a StringComparer explicitly.

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Asc(string leftColumnName, string rightColumnName)
    Parameters
    Type Name Description
    String leftColumnName

    Name of the left column.

    String rightColumnName

    Name of the right column.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.
    • RowComparer: columns have different types.
    • RowComparer: column type has no CompareTo() method.

    IRowComparerCommand<TLeft, TRight>.Asc(String, String, StringComparer)

    Includes the specified column pair in the comparison, with values evaluated in ascending order.

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

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Asc(string leftColumnName, string rightColumnName, StringComparer stringComparer)
    Parameters
    Type Name Description
    String leftColumnName

    Name of the left column.

    String rightColumnName

    Name of the right column.

    StringComparer stringComparer

    The StringComparer to use for the column comparison.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    ArgumentNullException

    stringComparer

    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.

    IRowComparerCommand<TLeft, TRight>.Asc(String, StringComparer)

    Includes the specified column pair in the comparison, with values evaluated in ascending order.

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

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Asc(string columnName, StringComparer stringComparer)
    Parameters
    Type Name Description
    String columnName

    Name of the left and right columns.

    StringComparer stringComparer

    The StringComparer to use for the column comparison.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    ArgumentNullException

    stringComparer

    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.

    IRowComparerCommand<TLeft, TRight>.Asc<TLeftColumn, TRightColumn>(String, Comparison<TLeftColumn, TRightColumn>)

    Includes the specified column pair in the comparison, with values evaluated in ascending order.

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

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Asc<TLeftColumn, TRightColumn>(string columnName, Comparison<TLeftColumn, TRightColumn> columnComparison)
    Parameters
    Type Name Description
    String columnName

    Name of the left and right columns.

    Comparison<TLeftColumn, TRightColumn> columnComparison

    The column comparison.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Type Parameters
    Name Description
    TLeftColumn

    The type of the left column.

    TRightColumn

    The type of the right column.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    ArgumentNullException

    columnComparison

    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.

    IRowComparerCommand<TLeft, TRight>.Asc<TLeftColumn, TRightColumn>(String, String, Comparison<TLeftColumn, TRightColumn>)

    Includes the specified column pair in the comparison, with values evaluated in ascending order.

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

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Asc<TLeftColumn, TRightColumn>(string leftColumnName, string rightColumnName, Comparison<TLeftColumn, TRightColumn> columnComparison)
    Parameters
    Type Name Description
    String leftColumnName

    Name of the left column.

    String rightColumnName

    Name of the right column.

    Comparison<TLeftColumn, TRightColumn> columnComparison

    The column comparison.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Type Parameters
    Name Description
    TLeftColumn

    The type of the left column.

    TRightColumn

    The type of the right column.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    ArgumentNullException

    columnComparison

    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.

    IRowComparerCommand<TLeft, TRight>.Desc(String)

    Includes the specified column pair in the comparison, with values evaluated in descending order.

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

    Columns must have identical types (although nullability can differ). If this is not the case, use an overload that specifies the comparison explicitly.

    While string columns use case sensitive comparisons with the current culture, do instead use overloads that specifies a StringComparer explicitly.

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Desc(string columnName)
    Parameters
    Type Name Description
    String columnName

    Name of the left and right columns.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.
    • RowComparer: columns have different types.
    • RowComparer: column type has no CompareTo() method.

    IRowComparerCommand<TLeft, TRight>.Desc(String, String)

    Includes the specified column pair in the comparison, with values evaluated in descending order.

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

    Columns must have identical types (although nullability can differ). If this is not the case, use an overload that specifies the comparison explicitly.

    While string columns use case sensitive comparisons with the current culture, do instead use overloads that specifies a StringComparer explicitly.

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Desc(string leftColumnName, string rightColumnName)
    Parameters
    Type Name Description
    String leftColumnName

    Name of the left column.

    String rightColumnName

    Name of the right column.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    InvalidOperationException
    • Found more than one member match in type.
    • No v CLR Type information available.
    • RowComparer: columns have different types.
    • RowComparer: column type has no CompareTo() method.

    IRowComparerCommand<TLeft, TRight>.Desc(String, String, StringComparer)

    Includes the specified column pair in the comparison, with values evaluated in descending order.

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

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Desc(string leftColumnName, string rightColumnName, StringComparer stringComparer)
    Parameters
    Type Name Description
    String leftColumnName

    Name of the left column.

    String rightColumnName

    Name of the right column.

    StringComparer stringComparer

    The StringComparer to use for the column comparison.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    ArgumentNullException

    stringComparer

    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.

    IRowComparerCommand<TLeft, TRight>.Desc(String, StringComparer)

    Includes the specified column pair in the comparison, with values evaluated in descending order.

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

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Desc(string columnName, StringComparer stringComparer)
    Parameters
    Type Name Description
    String columnName

    Name of the left and right columns.

    StringComparer stringComparer

    The StringComparer to use for the column comparison.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    ArgumentNullException

    stringComparer

    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.

    IRowComparerCommand<TLeft, TRight>.Desc<TLeftColumn, TRightColumn>(String, Comparison<TLeftColumn, TRightColumn>)

    Includes the specified column pair in the comparison, with values evaluated in descending order.

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

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Desc<TLeftColumn, TRightColumn>(string columnName, Comparison<TLeftColumn, TRightColumn> columnComparison)
    Parameters
    Type Name Description
    String columnName

    Name of the left and right columns.

    Comparison<TLeftColumn, TRightColumn> columnComparison

    The column comparison.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Type Parameters
    Name Description
    TLeftColumn

    The type of the left column.

    TRightColumn

    The type of the right column.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    ArgumentNullException

    columnComparison

    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.

    IRowComparerCommand<TLeft, TRight>.Desc<TLeftColumn, TRightColumn>(String, String, Comparison<TLeftColumn, TRightColumn>)

    Includes the specified column pair in the comparison, with values evaluated in descending order.

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

    Declaration
    IRowComparerCommand<TLeft, TRight> IRowComparerCommand<TLeft, TRight>.Desc<TLeftColumn, TRightColumn>(string leftColumnName, string rightColumnName, Comparison<TLeftColumn, TRightColumn> columnComparison)
    Parameters
    Type Name Description
    String leftColumnName

    Name of the left column.

    String rightColumnName

    Name of the right column.

    Comparison<TLeftColumn, TRightColumn> columnComparison

    The column comparison.

    Returns
    Type Description
    IRowComparerCommand<TLeft, TRight>

    The instance itself, for chaining multiple commands together.

    Type Parameters
    Name Description
    TLeftColumn

    The type of the left column.

    TRightColumn

    The type of the right column.

    Exceptions
    Type Condition
    ArgumentException
    • Column cannot be null or whitespace.
    • No matching column found.
    ArgumentNullException

    columnComparison

    InvalidOperationException
    • Found more than one member match in type.
    • No .NET CLR Type information available.

    Implements

    IRowComparerCommand<TLeft, TRight>
    IFluentInterface
    In This Article
    Back to top Copyright © 2023 Envobi Ltd