diff --git a/src/Mapster.Tests/WhenMappingWithDictionary.cs b/src/Mapster.Tests/WhenMappingWithDictionary.cs index 9912ffc5..2f0a1abd 100644 --- a/src/Mapster.Tests/WhenMappingWithDictionary.cs +++ b/src/Mapster.Tests/WhenMappingWithDictionary.cs @@ -60,7 +60,7 @@ public void Object_To_Dictionary_CamelCase() Name = "test", }; - var dict = TypeAdapter.Adapt>(poco); + var dict = TypeAdapter.Adapt>(poco); dict.Count.ShouldBe(2); dict["id"].ShouldBe(poco.Id); @@ -142,7 +142,6 @@ public void Dictionary_To_Object_Map() [TestMethod] public void Dictionary_To_Object_CamelCase() { - TypeAdapterConfig.GlobalSettings.EnableDebugging(); TypeAdapterConfig.GlobalSettings.Default.NameMatchingStrategy(NameMatchingStrategy.FromCamelCase); var dict = new Dictionary { @@ -208,7 +207,7 @@ public void Dictionary_Of_String_Mix() ["d"] = 4, ["e"] = null, }; - var result = dict.Adapt>(); + var result = dict.Adapt, Dictionary>(); result.Count.ShouldBe(2); result["A"].ShouldBe(1); result["_b"].ShouldBe(2); diff --git a/src/Mapster/Adapters/DictionaryAdapter.cs b/src/Mapster/Adapters/DictionaryAdapter.cs index 223b0042..fdd81a4b 100644 --- a/src/Mapster/Adapters/DictionaryAdapter.cs +++ b/src/Mapster/Adapters/DictionaryAdapter.cs @@ -198,8 +198,7 @@ protected override ClassModel GetClassModel(Type destinationType, CompileArgumen private static Func GetFunction(CompileArgument arg, Type dictType) { var strategy = arg.Settings.NameMatchingStrategy; - if (arg.MapType == MapType.MapToTarget && - strategy.DestinationMemberNameConverter != NameMatchingStrategy.Identity) + if (strategy.DestinationMemberNameConverter != NameMatchingStrategy.Identity) { var args = dictType.GetGenericArguments(); var getMethod = typeof(CoreExtensions).GetMethods() diff --git a/src/Mapster/Mapster.NetCore.csproj b/src/Mapster/Mapster.NetCore.csproj index b7c0cf61..e6a6a021 100644 --- a/src/Mapster/Mapster.NetCore.csproj +++ b/src/Mapster/Mapster.NetCore.csproj @@ -22,7 +22,7 @@ false false True - 3.1.2 + 3.1.3 Mapster