C# Class Neddle.Extensions.ObjectExtensions

Contains object extension methods.
Mostrar archivo Open project: kcargile/neddle

Public Methods

Method Description
CalculateHash ( this obj ) : int

Calculates a hash for the object using reflection.

NullSafeEquals ( this obj1, object obj2 ) : bool

Determines if the two objects are equivalent in a way that will not throw if the current object is null.

NullSafeHash ( this obj, int seed ) : int

Calculates a hash for the object in a way that will not throw or influence the value if the current object is null.

Method Details

CalculateHash() public static method

Calculates a hash for the object using reflection.
public static CalculateHash ( this obj ) : int
obj this The object.
return int

NullSafeEquals() public static method

Determines if the two objects are equivalent in a way that will not throw if the current object is null.
public static NullSafeEquals ( this obj1, object obj2 ) : bool
obj1 this The current object.
obj2 object The object to compare.
return bool

NullSafeHash() public static method

Calculates a hash for the object in a way that will not throw or influence the value if the current object is null.
public static NullSafeHash ( this obj, int seed ) : int
obj this The object.
seed int The seed.
return int