Equals
Equals method that lets you specify on what property or field value you want to compare an object on. Also compares the object types. Useful to use in an overridden Equals method of an object.
Source
public static bool Equals<T, TResult>(this T obj, object obj1, Func<T, TResult> selector)
{
return obj1 is T && selector(obj).Equals(selector((T)obj1));
}
Example
When used inside a custom "File" class: public override bool Equals(object obj)
{
return this.Equals(obj, x => x.Path);
}