コード例 #1
0
        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));
            }
        }
コード例 #2
0
 public static int HashCode(this object obj, string signature) => PropertyEvaluator.GetValue(obj, signature).GetHashCode();
コード例 #3
0
 public PropertyEvaluatorTrying(PropertyEvaluator evaluator) => this.evaluator = evaluator;
コード例 #4
0
        public static Maybe <object> GetValue(object obj, string signature)
        {
            var evaluator = new PropertyEvaluator(obj);

            return(((IHash <string, object>)evaluator).Map(signature, o => o));
        }