Unosquare
    Show / Hide Table of Contents

    Class ObjectComparer

    Represents a quick object comparer using the public properties of an object or the public members in a structure.

    Inheritance
    Object
    ObjectComparer
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Swan
    Syntax
    public static class ObjectComparer

    Methods

    AreEnumerationsEquals<T>(T, T)

    Compare if two enumerables are equal.

    Declaration
    public static bool AreEnumerationsEquals<T>(T left, T right)
    Parameters
    Type Name Description
    T left

    The left.

    T right

    The right.

    Returns
    Type Description
    Boolean

    true if two specified types are equal; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of enums to compare.

    AreEqual(Object, Object, Type)

    Compare if two variables of the same type are equal.

    Declaration
    public static bool AreEqual(object left, object right, Type targetType)
    Parameters
    Type Name Description
    Object left

    The left.

    Object right

    The right.

    Type targetType

    Type of the target.

    Returns
    Type Description
    Boolean

    true if the variables are equal; otherwise, false.

    AreEqual<T>(T, T)

    Compare if two variables of the same type are equal.

    Declaration
    public static bool AreEqual<T>(T left, T right)
    Parameters
    Type Name Description
    T left

    The left.

    T right

    The right.

    Returns
    Type Description
    Boolean

    true if the variables are equal; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of objects to compare.

    AreObjectsEqual(Object, Object, Type)

    Compare if two objects of the same type are equal.

    Declaration
    public static bool AreObjectsEqual(object left, object right, Type targetType)
    Parameters
    Type Name Description
    Object left

    The left.

    Object right

    The right.

    Type targetType

    Type of the target.

    Returns
    Type Description
    Boolean

    true if the objects are equal; otherwise, false.

    AreObjectsEqual<T>(T, T)

    Compare if two objects of the same type are equal.

    Declaration
    public static bool AreObjectsEqual<T>(T left, T right)
        where T : class
    Parameters
    Type Name Description
    T left

    The left.

    T right

    The right.

    Returns
    Type Description
    Boolean

    true if the objects are equal; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of objects to compare.

    AreStructsEqual(Object, Object, Type)

    Compare if two structures of the same type are equal.

    Declaration
    public static bool AreStructsEqual(object left, object right, Type targetType)
    Parameters
    Type Name Description
    Object left

    The left.

    Object right

    The right.

    Type targetType

    Type of the target.

    Returns
    Type Description
    Boolean

    true if the structs are equal; otherwise, false.

    AreStructsEqual<T>(T, T)

    Compare if two structures of the same type are equal.

    Declaration
    public static bool AreStructsEqual<T>(T left, T right)
        where T : struct
    Parameters
    Type Name Description
    T left

    The left.

    T right

    The right.

    Returns
    Type Description
    Boolean

    true if the structs are equal; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of structs to compare.

    Comments

    Back to top Copyright © 2017-2019 Unosquare