示例#1
0
 public void Execute(IResolutionContext context)
 {
     foreach (var prop in destinationProperties.Where(p => resolverContainer.WillResolve(p)))
     {
         var assignment = context.BuildValueAssignment(prop);
         var resolver   = resolverContainer.GetResolver(prop);
         var result     = resolver.TryResolve(context, prop);
         assignment.SetValue(result);
     }
 }
        private IResolveValue TryGetCandidate(IDescribeMappableProperty mappableProperty)
        {
            IResolveValue candidate = null;

            foreach (var container in containers)
            {
                if (container.WillResolve(mappableProperty) == false)
                {
                    continue;
                }
                IContainResolvers copy = container;
                candidate = copy.GetResolver(mappableProperty);
                if (typeof(IOverrideable).IsInstanceOfType(candidate) == false)
                {
                    return(candidate);
                }
                /*default resolver...keep trying but remember it in case none else be found*/
            }
            return(candidate);
        }