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))); }
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)); }