Ejemplo n.º 1
0
        private object GetDestValue(object src, object dest, IDescribeMappableProperty destinationProperty)
        {
            var collectionSpec = new SupportedCollectionTypeSpecification();

            if (collectionSpec.IsSatisfiedBy(src) == false)
            {
                if (collectionSpec.IsElement(destinationProperty))
                {
                    return(activate.CreateInstance(destinationProperty.PropertyType));
                }
                return(invoke.GetValue(destinationProperty.Name, dest) ?? activate.CreateInstance(destinationProperty.PropertyType));
            }
            return(activate.CreateCollectionInstance(destinationProperty.PropertyType, collectionSpec.GetLength(src)));
        }
Ejemplo n.º 2
0
        private object GetDestValue(object src, object dest,IDescribeMappableProperty destinationProperty)
        {
            var collectionSpec = new SupportedCollectionTypeSpecification();

            if (collectionSpec.IsSatisfiedBy(src) == false)
            {
                if (collectionSpec.IsElement(destinationProperty))
                {
                    return activate.CreateInstance(destinationProperty.PropertyType);
                }
                return invoke.GetValue(destinationProperty.Name, dest) ?? activate.CreateInstance(destinationProperty.PropertyType);
            }
            return activate.CreateCollectionInstance(destinationProperty.PropertyType, collectionSpec.GetLength(src));
        }