Esempio n. 1
0
        public DefaultConvention()
        {
            this.SourceMemberProvider = new SourceMemberProvider();
            this.TargetMemberProvider = new TargetMemberProvider();

            this.MatchingRules = new MatchingRules(cfg =>
            {
                cfg.GetOrAdd <ExactNameMatching>(rule => rule.IgnoreCase = true);
            });
        }
Esempio n. 2
0
        public DefaultMatchingRuleEvaluator(MatchingRules matchingRules)
        {
            if (matchingRules == null)
            {
                throw new ArgumentNullException(nameof(matchingRules));
            }

            this.MatchingRules = new ReadOnlyCollection <IMatchingRule>(matchingRules.ToList());

            Func <IMatchingRule, Type> ruleType = rule => rule.GetType().GetInterfaces()
                                                  .First(@interface => typeof(IMatchingRule).IsAssignableFrom(@interface));

            _ruleGroups = this.MatchingRules.GroupBy(ruleType).ToList();
        }