コード例 #1
0
 internal Likeness <TSource, TDestination> AddEvaluator(MemberEvaluator <TSource, TDestination> evaluator)
 {
     return(new Likeness <TSource, TDestination>(this.Value, this.comparer.Evaluators.Concat(new[] { evaluator }), this.comparer.DefaultMembersGenerator));
 }
コード例 #2
0
        /// <summary>
        /// Returns a new <see cref="Likeness{TSource, TDestination}"/> that includes the specified
        /// evaluator.
        /// </summary>
        /// <param name="evaluator">
        /// An expression that evaluates the source value against the destination value for the
        /// property or field encapsulated by the instance.</param>
        /// <returns>
        /// A new <see cref="Likeness{TSource, TDestination}"/> that includes
        /// <paramref name="evaluator"/>.
        /// </returns>
        public Likeness <TSource, TDestination> EqualsWhen(Func <TSource, TDestination, bool> evaluator)
        {
            var memberEvaluator = new MemberEvaluator <TSource, TDestination>(this.member, evaluator);

            return(this.likeness.AddEvaluator(memberEvaluator));
        }