C# Class Prototype.Tests.ObjectComparer

Originally from: http://cyotek.com/article/display/comparing-the-properties-of-two-objects-via-reflection
Afficher le fichier Open project: paralect/prototype

Méthodes publiques

Méthode Description
AreObjectsEqual ( object objectA, object objectB, IgnoreList ignoreList = null ) : bool

Compares the properties of two objects of the same type and returns if all properties are equal.

Private Methods

Méthode Description
AreValuesEqual ( object valueA, object valueB ) : bool

Compares two values and returns if they are the same.

CanDirectlyCompare ( Type type ) : bool

Determines whether value instances of the specified type can be directly compared.

IsPresentInIgnoreList ( IgnoreList ignoreList, Type type, PropertyInfo propertyInfo ) : bool

Method Details

AreObjectsEqual() public static méthode

Compares the properties of two objects of the same type and returns if all properties are equal.
public static AreObjectsEqual ( object objectA, object objectB, IgnoreList ignoreList = null ) : bool
objectA object The first object to compare.
objectB object The second object to compre.
ignoreList IgnoreList A Dictionary to ignore from the comparison where keys is type and vae is list of property names
Résultat bool