public void SetMapping <TSource, TTarget>(Convert <object, object> function) { Type sourceType = typeof(TSource); Type targetType = typeof(TTarget); TypeMappingKey key = new TypeMappingKey(sourceType, targetType); _internalDictionary[key] = function; }
public bool IsSupported <TSource, TTarget>() { Type sourceType = typeof(TSource); Type targetType = typeof(TTarget); TypeMappingKey key = new TypeMappingKey(sourceType, targetType); return(_internalDictionary.ContainsKey(key)); }
public Convert <object, object> GetMapping(Type sourceType, Type targetType) { TypeMappingKey key = new TypeMappingKey(sourceType, targetType); if (_internalDictionary.ContainsKey(key)) { return(_internalDictionary[key]); } return(null); }
public void SetMapping(Type sourceType, Type targetType, Convert <object, object> function) { TypeMappingKey key = new TypeMappingKey(sourceType, targetType); _internalDictionary[key] = function; }
public bool IsSupported(Type sourceType, Type targetType) { TypeMappingKey key = new TypeMappingKey(sourceType, targetType); return(_internalDictionary.ContainsKey(key)); }