Bosphorus.Dao.Common.Mapper.Default.ValueInjectorFlattenMapper.GetTargetValue C# (CSharp) Method

GetTargetValue() private method

private GetTargetValue ( Type sourceType, object sourceValue, Type targetType ) : object
sourceType System.Type
sourceValue object
targetType System.Type
return object
        private object GetTargetValue(Type sourceType, object sourceValue, Type targetType)
        {
            if (sourceType.IsValueType || sourceType == typeof(string))
                return sourceValue;

            object targetValue = instantiator.Create(targetType);
            lazyMapper.Service.Map(sourceType, sourceValue, targetType, targetValue);
            return targetValue;
        }
    }