예제 #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();
 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));
        }