public MapperAction <TContext> GetMapper(Type fromType, Type toType) { var toNullableType = toType.GetGenericArguments()[0]; _mapper.RequireOneWayMap(fromType, toNullableType, "MapNonNullableToNullable"); var nonNullToNullMapper = _mapper.GetMapper(fromType, toNullableType); return((from, to, context) => nonNullToNullMapper.MapObject(from, to, context)); }
public IMappingCollection <TFrom, TTo, TContext> RequireOneWayMap(Type from, Type to) { _mapper.RequireOneWayMap(from, to, typeof(TFrom), typeof(TTo)); return(this); }