public static int HashCode(this object obj, int prime = 397) { var evaluator = new PropertyEvaluator(obj); unchecked { return(evaluator.Signatures.Aggregate(prime, (current, signature) => current * prime + evaluator[signature]?.GetHashCode() ?? 0)); } }
public static int HashCode(this object obj, string signature) => PropertyEvaluator.GetValue(obj, signature).GetHashCode();
public PropertyEvaluatorTrying(PropertyEvaluator evaluator) => this.evaluator = evaluator;
public static Maybe <object> GetValue(object obj, string signature) { var evaluator = new PropertyEvaluator(obj); return(((IHash <string, object>)evaluator).Map(signature, o => o)); }