Skip to content

Commit a009eff

Browse files
Alizadeh, RouhallahAlizadeh, Rouhallah
authored andcommitted
use config.ForType insted of config.NewConfig
1 parent 1c2ee28 commit a009eff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Mapster/TypeAdapter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ public static TDestination Adapt<TDestination>(this object? source, Action<TypeA
294294
public static TDestination Adapt<TSource, TDestination>(this object? source, Action<TypeAdapterSetter<TSource, TDestination>> configAction)
295295
{
296296
var config = TypeAdapterConfig.GlobalSettings.Clone();
297-
var setter = config.NewConfig<TSource, TDestination>();
297+
var setter = config.ForType<TSource, TDestination>();
298298
configAction(setter);
299+
setter.Settings.Resolvers.Reverse();
299300
return source.Adapt<TDestination>(config);
300301
}
301302
}

0 commit comments

Comments
 (0)