private static void ExecuteMapMethod(Type sourceType, Type targetType, IMappingContainer container, object sourceValue, object targetValue) { _mapMethods.GetOrAdd(Pair.Create(sourceType, targetType), key => CreateMapMethod(key.First, key.Second))?.DynamicInvoke(container, sourceValue, targetValue); }
private static object ExecuteConvertMethod(Type sourceType, Type targetType, IMappingContainer container, object sourceValue) { return(_convertMethods.GetOrAdd(Pair.Create(sourceType, targetType), key => CreateConvertMethod(key.First, key.Second)).DynamicInvoke(container, sourceValue)); }