public ConfigurationValidator(Type destinationType, IDescribeMappableProperty[] destinationProperties,
                               IContainResolvers[] resolverContainers)
 {
     if (destinationProperties.Length == 0)
         throw new DittoConfigurationException("Destination properties have not been queried for {0}",destinationType);
     missingProperties = new MissingProperties();
     this.destinationType = destinationType;
     this.destinationProperties = destinationProperties;
     this.resolverContainers = resolverContainers;
 }
 public PrioritizedComposedFirstMatchingResolverContainer(IContainResolvers[] containers)
 {
     if(containers==null || containers.Length==0)
     {
         this.containers=new IContainResolvers[]{new NullResolverContainer()};
     }
     else
     {
         this.containers = containers;
     }
 }
        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);
        }
 public SourcedExecutableMapping(Type sourceType, Type destinationType, IContainResolvers resolverContainer, IDescribeMappableProperty[] destinationProperties)
 {
 }
 public void SourceResolverContainer(Type sourceType, IContainResolvers sourcedResolverContainer)
 {
     //it might seem superflous to have the resolver containers assigned twice, but caching shouldn't be an requirement
     sourceType2ResolverContainer[sourceType] = sourcedResolverContainer;
 }
Exemple #6
0
 public ExecutableMapping(Type destinationType, IContainResolvers resolverContainer,IDescribeMappableProperty[] destinationProperties)
 {
     DestinationType = destinationType;
     this.resolverContainer = resolverContainer;
     this.destinationProperties = destinationProperties;
 }
Exemple #7
0
 public ExecutableMapping(Type destinationType, IContainResolvers resolverContainer, IDescribeMappableProperty[] destinationProperties)
 {
     DestinationType            = destinationType;
     this.resolverContainer     = resolverContainer;
     this.destinationProperties = destinationProperties;
 }
 public SourcedExecutableMapping(Type sourceType,Type destinationType, IContainResolvers resolverContainer, IDescribeMappableProperty[] destinationProperties)
 {
 }
 public void SourceResolverContainer(Type sourceType, IContainResolvers sourcedResolverContainer)
 {
     //it might seem superflous to have the resolver containers assigned twice, but caching shouldn't be an requirement
     sourceType2ResolverContainer[sourceType] = sourcedResolverContainer;
 }