From 782c83a70d356a02485b0477ba20227088c80f22 Mon Sep 17 00:00:00 2001 From: Eric Swann Date: Wed, 20 Jan 2016 08:53:14 -0600 Subject: [PATCH 1/2] Added extension methods/fixed issue in docs with 'OfType' -> 'ForType' --- README.md | 8 +- src/Mapster.Tests/Mapster.Tests.csproj | 1 + .../WhenMappingWithExtensionMethods.cs | 73 ++ src/Mapster/TypeAdapter.cs | 12 +- src/Mapster/project.lock.json | 859 ++---------------- 5 files changed, 182 insertions(+), 771 deletions(-) create mode 100644 src/Mapster.Tests/WhenMappingWithExtensionMethods.cs diff --git a/README.md b/README.md index f8e6fe97..7c32ecf5 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,10 @@ or just var destObject = TypeAdapter.Adapt(sourceObject); +or using extension methods + + var destObject = sourceObject.Adapt + #####Mapping to an existing object You make the object, Mapster maps to the object. @@ -233,9 +237,9 @@ You may wish to have different settings in different scenarios. If you would not var config = new TypeAdapterConfig(); config.Default.Ignore("Id"); -For type mapping, you can use `OfType` method. +For type mapping, you can use `ForType` method. - config.OfType() + config.ForType() .Map(dest => dest.FullName, src => string.Format("{0} {1}", src.FirstName, src.LastName)); diff --git a/src/Mapster.Tests/Mapster.Tests.csproj b/src/Mapster.Tests/Mapster.Tests.csproj index 11541e23..624dddc9 100644 --- a/src/Mapster.Tests/Mapster.Tests.csproj +++ b/src/Mapster.Tests/Mapster.Tests.csproj @@ -66,6 +66,7 @@ + diff --git a/src/Mapster.Tests/WhenMappingWithExtensionMethods.cs b/src/Mapster.Tests/WhenMappingWithExtensionMethods.cs new file mode 100644 index 00000000..f5d34c0a --- /dev/null +++ b/src/Mapster.Tests/WhenMappingWithExtensionMethods.cs @@ -0,0 +1,73 @@ +using System; +using Mapster.Tests.Classes; +using NUnit.Framework; +using Should; + +namespace Mapster.Tests +{ + /// + /// Not trying to test core testing here...just a few tests to make sure the extension method approach doesn't hose anything + /// + [TestFixture] + public class WhenMappingWithExtensionMethods + { + + [Test] + public void Adapt_With_Source_And_Destination_Type_Succeeds() + { + TypeAdapterConfig.NewConfig() + .Compile(); + + var product = new Product { Id = Guid.NewGuid(), Title = "ProductA", CreatedUser = new User { Name = "UserA" } }; + + var dto = product.Adapt(); + + dto.ShouldNotBeNull(); + dto.Id.ShouldEqual(product.Id); + } + + [Test] + public void Adapt_With_Source_And_Destination_Types_And_Config_Succeeds() + { + var config = new TypeAdapterConfig(); + config.ForType(); + + + var product = new Product { Id = Guid.NewGuid(), Title = "ProductA", CreatedUser = new User { Name = "UserA" } }; + + var dto = product.Adapt(config); + + dto.ShouldNotBeNull(); + dto.Id.ShouldEqual(product.Id); + } + + [Test] + public void Adapt_With_Destination_Type_Succeeds() + { + TypeAdapterConfig.NewConfig() + .Compile(); + + var product = new Product { Id = Guid.NewGuid(), Title = "ProductA", CreatedUser = new User { Name = "UserA" } }; + + var dto = product.Adapt(); + + dto.ShouldNotBeNull(); + dto.Id.ShouldEqual(product.Id); + } + + [Test] + public void Adapt_With_Destination_Type_And_Config_Succeeds() + { + var config = new TypeAdapterConfig(); + config.ForType(); + + + var product = new Product { Id = Guid.NewGuid(), Title = "ProductA", CreatedUser = new User { Name = "UserA" } }; + + var dto = product.Adapt(config); + + dto.ShouldNotBeNull(); + dto.Id.ShouldEqual(product.Id); + } + } +} diff --git a/src/Mapster/TypeAdapter.cs b/src/Mapster/TypeAdapter.cs index 21e9a6c4..2966c17c 100644 --- a/src/Mapster/TypeAdapter.cs +++ b/src/Mapster/TypeAdapter.cs @@ -11,7 +11,7 @@ public static class TypeAdapter /// Source object to adapt. /// Configuration /// Adapted destination type. - public static TDestination Adapt(object source, TypeAdapterConfig config = null) + public static TDestination Adapt(this object source, TypeAdapterConfig config = null) { config = config ?? TypeAdapterConfig.GlobalSettings; dynamic fn = config.GetMapFunction(source.GetType(), typeof(TDestination)); @@ -32,7 +32,7 @@ public static TDestination Adapt(object source, TypeAdapterConfig /// Destination type. /// Source object to adapt. /// Adapted destination type. - public static TDestination Adapt(TSource source) + public static TDestination Adapt(this TSource source) { try { @@ -52,7 +52,7 @@ public static TDestination Adapt(TSource source) /// Source object to adapt. /// Configuration /// Adapted destination type. - public static TDestination Adapt(TSource source, TypeAdapterConfig config) + public static TDestination Adapt(this TSource source, TypeAdapterConfig config) { var fn = config.GetMapFunction(); try @@ -74,7 +74,7 @@ public static TDestination Adapt(TSource source, TypeAdap /// The destination object to populate. /// Configuration /// Adapted destination type. - public static TDestination Adapt(TSource source, TDestination destination, TypeAdapterConfig config = null) + public static TDestination Adapt(this TSource source, TDestination destination, TypeAdapterConfig config = null) { config = config ?? TypeAdapterConfig.GlobalSettings; var fn = config.GetMapToTargetFunction(); @@ -97,7 +97,7 @@ public static TDestination Adapt(TSource source, TDestina /// The type of the destination object. /// Configuration /// Adapted destination type. - public static object Adapt(object source, Type sourceType, Type destinationType, TypeAdapterConfig config = null) + public static object Adapt(this object source, Type sourceType, Type destinationType, TypeAdapterConfig config = null) { config = config ?? TypeAdapterConfig.GlobalSettings; dynamic fn = config.GetMapFunction(sourceType, destinationType); @@ -120,7 +120,7 @@ public static object Adapt(object source, Type sourceType, Type destinationType, /// The type of the destination object. /// Configuration /// Adapted destination type. - public static object Adapt(object source, object destination, Type sourceType, Type destinationType, TypeAdapterConfig config = null) + public static object Adapt(this object source, object destination, Type sourceType, Type destinationType, TypeAdapterConfig config = null) { config = config ?? TypeAdapterConfig.GlobalSettings; dynamic fn = config.GetMapToTargetFunction(sourceType, destinationType); diff --git a/src/Mapster/project.lock.json b/src/Mapster/project.lock.json index d0eef7a8..64844f54 100644 --- a/src/Mapster/project.lock.json +++ b/src/Mapster/project.lock.json @@ -1,29 +1,28 @@ { "locked": false, - "version": 2, + "version": 1, "targets": { ".NETFramework,Version=v4.0": {}, ".NETFramework,Version=v4.5": {}, ".NETPlatform,Version=v5.4": { "Microsoft.CSharp/4.0.0": { - "type": "package", "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Dynamic.Runtime": "4.0.0", - "System.Globalization": "4.0.10", - "System.Linq": "4.0.0", - "System.Linq.Expressions": "4.0.0", - "System.ObjectModel": "4.0.10", - "System.Reflection": "4.0.10", - "System.Reflection.Extensions": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Reflection.TypeExtensions": "4.0.0", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10", - "System.Runtime.InteropServices": "4.0.20", - "System.Threading": "4.0.10" + "System.Collections": "[4.0.10, )", + "System.Diagnostics.Debug": "[4.0.10, )", + "System.Dynamic.Runtime": "[4.0.0, )", + "System.Globalization": "[4.0.10, )", + "System.Linq": "[4.0.0, )", + "System.Linq.Expressions": "[4.0.0, )", + "System.ObjectModel": "[4.0.10, )", + "System.Reflection": "[4.0.10, )", + "System.Reflection.Extensions": "[4.0.0, )", + "System.Reflection.Primitives": "[4.0.0, )", + "System.Reflection.TypeExtensions": "[4.0.0, )", + "System.Resources.ResourceManager": "[4.0.0, )", + "System.Runtime": "[4.0.20, )", + "System.Runtime.Extensions": "[4.0.10, )", + "System.Runtime.InteropServices": "[4.0.20, )", + "System.Threading": "[4.0.10, )" }, "compile": { "ref/dotnet/Microsoft.CSharp.dll": {} @@ -33,23 +32,21 @@ } }, "System.Collections/4.0.10": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0" + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Collections.dll": {} } }, "System.Collections.NonGeneric/4.0.0": { - "type": "package", "dependencies": { - "System.Diagnostics.Debug": "4.0.10", - "System.Globalization": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10", - "System.Threading": "4.0.10" + "System.Diagnostics.Debug": "[4.0.10, )", + "System.Globalization": "[4.0.10, )", + "System.Resources.ResourceManager": "[4.0.0, )", + "System.Runtime": "[4.0.20, )", + "System.Runtime.Extensions": "[4.0.10, )", + "System.Threading": "[4.0.10, )" }, "compile": { "ref/dotnet/System.Collections.NonGeneric.dll": {} @@ -59,54 +56,49 @@ } }, "System.Diagnostics.Debug/4.0.10": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0" + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Diagnostics.Debug.dll": {} } }, "System.Dynamic.Runtime/4.0.0": { - "type": "package", "dependencies": { - "System.Linq.Expressions": "4.0.0", - "System.ObjectModel": "4.0.0", - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" + "System.Linq.Expressions": "[4.0.0, )", + "System.ObjectModel": "[4.0.0, )", + "System.Reflection": "[4.0.0, )", + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Dynamic.Runtime.dll": {} } }, "System.Globalization/4.0.10": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0" + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Globalization.dll": {} } }, "System.IO/4.0.0": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0", - "System.Text.Encoding": "4.0.0", - "System.Threading.Tasks": "4.0.0" + "System.Runtime": "[4.0.0, )", + "System.Text.Encoding": "[4.0.0, )", + "System.Threading.Tasks": "[4.0.0, )" }, "compile": { "ref/dotnet/System.IO.dll": {} } }, "System.Linq/4.0.0": { - "type": "package", "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10" + "System.Collections": "[4.0.10, )", + "System.Diagnostics.Debug": "[4.0.10, )", + "System.Resources.ResourceManager": "[4.0.0, )", + "System.Runtime": "[4.0.20, )", + "System.Runtime.Extensions": "[4.0.10, )" }, "compile": { "ref/dotnet/System.Linq.dll": {} @@ -116,25 +108,23 @@ } }, "System.Linq.Expressions/4.0.10": { - "type": "package", "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" + "System.Reflection": "[4.0.0, )", + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Linq.Expressions.dll": {} } }, "System.Linq.Queryable/4.0.0": { - "type": "package", "dependencies": { - "System.Collections": "4.0.10", - "System.Linq": "4.0.0", - "System.Linq.Expressions": "4.0.10", - "System.Reflection": "4.0.10", - "System.Reflection.Extensions": "4.0.0", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20" + "System.Collections": "[4.0.10, )", + "System.Linq": "[4.0.0, )", + "System.Linq.Expressions": "[4.0.10, )", + "System.Reflection": "[4.0.10, )", + "System.Reflection.Extensions": "[4.0.0, )", + "System.Resources.ResourceManager": "[4.0.0, )", + "System.Runtime": "[4.0.20, )" }, "compile": { "ref/dotnet/System.Linq.Queryable.dll": {} @@ -144,13 +134,12 @@ } }, "System.ObjectModel/4.0.10": { - "type": "package", "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Threading": "4.0.10" + "System.Collections": "[4.0.10, )", + "System.Diagnostics.Debug": "[4.0.10, )", + "System.Resources.ResourceManager": "[4.0.0, )", + "System.Runtime": "[4.0.20, )", + "System.Threading": "[4.0.10, )" }, "compile": { "ref/dotnet/System.ObjectModel.dll": {} @@ -160,707 +149,103 @@ } }, "System.Reflection/4.0.10": { - "type": "package", "dependencies": { - "System.IO": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.20" + "System.IO": "[4.0.0, )", + "System.Reflection.Primitives": "[4.0.0, )", + "System.Runtime": "[4.0.20, )" }, "compile": { "ref/dotnet/System.Reflection.dll": {} } }, "System.Reflection.Extensions/4.0.0": { - "type": "package", "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" + "System.Reflection": "[4.0.0, )", + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Reflection.Extensions.dll": {} } }, "System.Reflection.Primitives/4.0.0": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0" + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Reflection.Primitives.dll": {} } }, "System.Reflection.TypeExtensions/4.0.0": { - "type": "package", "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" + "System.Reflection": "[4.0.0, )", + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Reflection.TypeExtensions.dll": {} } }, "System.Resources.ResourceManager/4.0.0": { - "type": "package", "dependencies": { - "System.Globalization": "4.0.0", - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" + "System.Globalization": "[4.0.0, )", + "System.Reflection": "[4.0.0, )", + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Resources.ResourceManager.dll": {} } }, "System.Runtime/4.0.20": { - "type": "package", "compile": { "ref/dotnet/System.Runtime.dll": {} } }, "System.Runtime.Extensions/4.0.10": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.20" + "System.Runtime": "[4.0.20, )" }, "compile": { "ref/dotnet/System.Runtime.Extensions.dll": {} } }, "System.Runtime.Handles/4.0.0": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0" + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Runtime.Handles.dll": {} } }, "System.Runtime.InteropServices/4.0.20": { - "type": "package", "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0", - "System.Runtime.Handles": "4.0.0" + "System.Reflection": "[4.0.0, )", + "System.Reflection.Primitives": "[4.0.0, )", + "System.Runtime": "[4.0.0, )", + "System.Runtime.Handles": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Runtime.InteropServices.dll": {} } }, "System.Text.Encoding/4.0.0": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0" + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Text.Encoding.dll": {} } }, "System.Threading/4.0.10": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0", - "System.Threading.Tasks": "4.0.0" + "System.Runtime": "[4.0.0, )", + "System.Threading.Tasks": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Threading.dll": {} } }, "System.Threading.Tasks/4.0.0": { - "type": "package", "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Threading.Tasks.dll": {} - } - } - }, - ".NETFramework,Version=v4.0/win7-x86": {}, - ".NETFramework,Version=v4.0/win7-x64": {}, - ".NETFramework,Version=v4.5/win7-x86": {}, - ".NETFramework,Version=v4.5/win7-x64": {}, - ".NETPlatform,Version=v5.4/win7-x86": { - "Microsoft.CSharp/4.0.0": { - "type": "package", - "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Dynamic.Runtime": "4.0.0", - "System.Globalization": "4.0.10", - "System.Linq": "4.0.0", - "System.Linq.Expressions": "4.0.0", - "System.ObjectModel": "4.0.10", - "System.Reflection": "4.0.10", - "System.Reflection.Extensions": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Reflection.TypeExtensions": "4.0.0", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10", - "System.Runtime.InteropServices": "4.0.20", - "System.Threading": "4.0.10" - }, - "compile": { - "ref/dotnet/Microsoft.CSharp.dll": {} - }, - "runtime": { - "lib/dotnet/Microsoft.CSharp.dll": {} - } - }, - "System.Collections/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Collections.dll": {} - } - }, - "System.Collections.NonGeneric/4.0.0": { - "type": "package", - "dependencies": { - "System.Diagnostics.Debug": "4.0.10", - "System.Globalization": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10", - "System.Threading": "4.0.10" - }, - "compile": { - "ref/dotnet/System.Collections.NonGeneric.dll": {} - }, - "runtime": { - "lib/dotnet/System.Collections.NonGeneric.dll": {} - } - }, - "System.Diagnostics.Debug/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Diagnostics.Debug.dll": {} - } - }, - "System.Dynamic.Runtime/4.0.0": { - "type": "package", - "dependencies": { - "System.Linq.Expressions": "4.0.0", - "System.ObjectModel": "4.0.0", - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Dynamic.Runtime.dll": {} - } - }, - "System.Globalization/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Globalization.dll": {} - } - }, - "System.IO/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0", - "System.Text.Encoding": "4.0.0", - "System.Threading.Tasks": "4.0.0" - }, - "compile": { - "ref/dotnet/System.IO.dll": {} - } - }, - "System.Linq/4.0.0": { - "type": "package", - "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10" - }, - "compile": { - "ref/dotnet/System.Linq.dll": {} - }, - "runtime": { - "lib/dotnet/System.Linq.dll": {} - } - }, - "System.Linq.Expressions/4.0.10": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Linq.Expressions.dll": {} - } - }, - "System.Linq.Queryable/4.0.0": { - "type": "package", - "dependencies": { - "System.Collections": "4.0.10", - "System.Linq": "4.0.0", - "System.Linq.Expressions": "4.0.10", - "System.Reflection": "4.0.10", - "System.Reflection.Extensions": "4.0.0", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20" - }, - "compile": { - "ref/dotnet/System.Linq.Queryable.dll": {} - }, - "runtime": { - "lib/dotnet/System.Linq.Queryable.dll": {} - } - }, - "System.ObjectModel/4.0.10": { - "type": "package", - "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Threading": "4.0.10" - }, - "compile": { - "ref/dotnet/System.ObjectModel.dll": {} - }, - "runtime": { - "lib/dotnet/System.ObjectModel.dll": {} - } - }, - "System.Reflection/4.0.10": { - "type": "package", - "dependencies": { - "System.IO": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.20" - }, - "compile": { - "ref/dotnet/System.Reflection.dll": {} - } - }, - "System.Reflection.Emit.ILGeneration/4.0.0": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.Emit.ILGeneration.dll": {} - } - }, - "System.Reflection.Emit.Lightweight/4.0.0": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Emit.ILGeneration": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.Emit.Lightweight.dll": {} - } - }, - "System.Reflection.Extensions/4.0.0": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.Extensions.dll": {} - } - }, - "System.Reflection.Primitives/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.Primitives.dll": {} - } - }, - "System.Reflection.TypeExtensions/4.0.0": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.TypeExtensions.dll": {} - } - }, - "System.Resources.ResourceManager/4.0.0": { - "type": "package", - "dependencies": { - "System.Globalization": "4.0.0", - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Resources.ResourceManager.dll": {} - } - }, - "System.Runtime/4.0.20": { - "type": "package", - "compile": { - "ref/dotnet/System.Runtime.dll": {} - } - }, - "System.Runtime.Extensions/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.20" - }, - "compile": { - "ref/dotnet/System.Runtime.Extensions.dll": {} - } - }, - "System.Runtime.Handles/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Runtime.Handles.dll": {} - } - }, - "System.Runtime.InteropServices/4.0.20": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0", - "System.Runtime.Handles": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Runtime.InteropServices.dll": {} - } - }, - "System.Text.Encoding/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Text.Encoding.dll": {} - } - }, - "System.Threading/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0", - "System.Threading.Tasks": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Threading.dll": {} - } - }, - "System.Threading.Tasks/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Threading.Tasks.dll": {} - } - } - }, - ".NETPlatform,Version=v5.4/win7-x64": { - "Microsoft.CSharp/4.0.0": { - "type": "package", - "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Dynamic.Runtime": "4.0.0", - "System.Globalization": "4.0.10", - "System.Linq": "4.0.0", - "System.Linq.Expressions": "4.0.0", - "System.ObjectModel": "4.0.10", - "System.Reflection": "4.0.10", - "System.Reflection.Extensions": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Reflection.TypeExtensions": "4.0.0", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10", - "System.Runtime.InteropServices": "4.0.20", - "System.Threading": "4.0.10" - }, - "compile": { - "ref/dotnet/Microsoft.CSharp.dll": {} - }, - "runtime": { - "lib/dotnet/Microsoft.CSharp.dll": {} - } - }, - "System.Collections/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Collections.dll": {} - } - }, - "System.Collections.NonGeneric/4.0.0": { - "type": "package", - "dependencies": { - "System.Diagnostics.Debug": "4.0.10", - "System.Globalization": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10", - "System.Threading": "4.0.10" - }, - "compile": { - "ref/dotnet/System.Collections.NonGeneric.dll": {} - }, - "runtime": { - "lib/dotnet/System.Collections.NonGeneric.dll": {} - } - }, - "System.Diagnostics.Debug/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Diagnostics.Debug.dll": {} - } - }, - "System.Dynamic.Runtime/4.0.0": { - "type": "package", - "dependencies": { - "System.Linq.Expressions": "4.0.0", - "System.ObjectModel": "4.0.0", - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Dynamic.Runtime.dll": {} - } - }, - "System.Globalization/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Globalization.dll": {} - } - }, - "System.IO/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0", - "System.Text.Encoding": "4.0.0", - "System.Threading.Tasks": "4.0.0" - }, - "compile": { - "ref/dotnet/System.IO.dll": {} - } - }, - "System.Linq/4.0.0": { - "type": "package", - "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Runtime.Extensions": "4.0.10" - }, - "compile": { - "ref/dotnet/System.Linq.dll": {} - }, - "runtime": { - "lib/dotnet/System.Linq.dll": {} - } - }, - "System.Linq.Expressions/4.0.10": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Linq.Expressions.dll": {} - } - }, - "System.Linq.Queryable/4.0.0": { - "type": "package", - "dependencies": { - "System.Collections": "4.0.10", - "System.Linq": "4.0.0", - "System.Linq.Expressions": "4.0.10", - "System.Reflection": "4.0.10", - "System.Reflection.Extensions": "4.0.0", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20" - }, - "compile": { - "ref/dotnet/System.Linq.Queryable.dll": {} - }, - "runtime": { - "lib/dotnet/System.Linq.Queryable.dll": {} - } - }, - "System.ObjectModel/4.0.10": { - "type": "package", - "dependencies": { - "System.Collections": "4.0.10", - "System.Diagnostics.Debug": "4.0.10", - "System.Resources.ResourceManager": "4.0.0", - "System.Runtime": "4.0.20", - "System.Threading": "4.0.10" - }, - "compile": { - "ref/dotnet/System.ObjectModel.dll": {} - }, - "runtime": { - "lib/dotnet/System.ObjectModel.dll": {} - } - }, - "System.Reflection/4.0.10": { - "type": "package", - "dependencies": { - "System.IO": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.20" - }, - "compile": { - "ref/dotnet/System.Reflection.dll": {} - } - }, - "System.Reflection.Emit.ILGeneration/4.0.0": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.Emit.ILGeneration.dll": {} - } - }, - "System.Reflection.Emit.Lightweight/4.0.0": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Emit.ILGeneration": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.Emit.Lightweight.dll": {} - } - }, - "System.Reflection.Extensions/4.0.0": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.Extensions.dll": {} - } - }, - "System.Reflection.Primitives/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.Primitives.dll": {} - } - }, - "System.Reflection.TypeExtensions/4.0.0": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Reflection.TypeExtensions.dll": {} - } - }, - "System.Resources.ResourceManager/4.0.0": { - "type": "package", - "dependencies": { - "System.Globalization": "4.0.0", - "System.Reflection": "4.0.0", - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Resources.ResourceManager.dll": {} - } - }, - "System.Runtime/4.0.20": { - "type": "package", - "compile": { - "ref/dotnet/System.Runtime.dll": {} - } - }, - "System.Runtime.Extensions/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.20" - }, - "compile": { - "ref/dotnet/System.Runtime.Extensions.dll": {} - } - }, - "System.Runtime.Handles/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Runtime.Handles.dll": {} - } - }, - "System.Runtime.InteropServices/4.0.20": { - "type": "package", - "dependencies": { - "System.Reflection": "4.0.0", - "System.Reflection.Primitives": "4.0.0", - "System.Runtime": "4.0.0", - "System.Runtime.Handles": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Runtime.InteropServices.dll": {} - } - }, - "System.Text.Encoding/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Text.Encoding.dll": {} - } - }, - "System.Threading/4.0.10": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0", - "System.Threading.Tasks": "4.0.0" - }, - "compile": { - "ref/dotnet/System.Threading.dll": {} - } - }, - "System.Threading.Tasks/4.0.0": { - "type": "package", - "dependencies": { - "System.Runtime": "4.0.0" + "System.Runtime": "[4.0.0, )" }, "compile": { "ref/dotnet/System.Threading.Tasks.dll": {} @@ -870,8 +255,8 @@ }, "libraries": { "Microsoft.CSharp/4.0.0": { - "type": "package", "sha512": "oWqeKUxHXdK6dL2CFjgMcaBISbkk+AqEg+yvJHE4DElNzS4QaTsCflgkkqZwVlWby1Dg9zo9n+iCAMFefFdJ/A==", + "type": "package", "files": [ "lib/dotnet/Microsoft.CSharp.dll", "lib/MonoAndroid10/_._", @@ -910,8 +295,8 @@ ] }, "System.Collections/4.0.10": { - "type": "package", "sha512": "ux6ilcZZjV/Gp7JEZpe+2V1eTueq6NuoGRM3eZCFuPM25hLVVgCRuea6STW8hvqreIOE59irJk5/ovpA5xQipw==", + "type": "package", "files": [ "lib/DNXCore50/System.Collections.dll", "lib/MonoAndroid10/_._", @@ -943,8 +328,8 @@ ] }, "System.Collections.NonGeneric/4.0.0": { - "type": "package", "sha512": "rVgwrFBMkmp8LI6GhAYd6Bx+2uLIXjRfNg6Ie+ASfX8ESuh9e2HNxFy2yh1MPIXZq3OAYa+0mmULVwpnEC6UDA==", + "type": "package", "files": [ "lib/dotnet/System.Collections.NonGeneric.dll", "lib/MonoAndroid10/_._", @@ -974,8 +359,8 @@ ] }, "System.Diagnostics.Debug/4.0.10": { - "type": "package", "sha512": "pi2KthuvI2LWV2c2V+fwReDsDiKpNl040h6DcwFOb59SafsPT/V1fCy0z66OKwysurJkBMmp5j5CBe3Um+ub0g==", + "type": "package", "files": [ "lib/DNXCore50/System.Diagnostics.Debug.dll", "lib/MonoAndroid10/_._", @@ -1007,8 +392,8 @@ ] }, "System.Dynamic.Runtime/4.0.0": { - "type": "package", "sha512": "33os71rQUCLjM5pbhQqCopq9/YcqBHPBQ8WylrzNk3oJmfAR0SFwzZIKJRN2JcrkBYdzC/NtWrYVU8oroyZieA==", + "type": "package", "files": [ "lib/MonoAndroid10/_._", "lib/MonoTouch10/_._", @@ -1055,8 +440,8 @@ ] }, "System.Globalization/4.0.10": { - "type": "package", "sha512": "kzRtbbCNAxdafFBDogcM36ehA3th8c1PGiz8QRkZn8O5yMBorDHSK8/TGJPYOaCS5zdsGk0u9qXHnW91nqy7fw==", + "type": "package", "files": [ "lib/DNXCore50/System.Globalization.dll", "lib/MonoAndroid10/_._", @@ -1088,8 +473,8 @@ ] }, "System.IO/4.0.0": { - "type": "package", "sha512": "MoCHQ0u5n0OMwUS8OX4Gl48qKiQziSW5cXvt82d+MmAcsLq9OL90+ihnu/aJ1h6OOYcBswrZAEuApfZha9w2lg==", + "type": "package", "files": [ "lib/MonoAndroid10/_._", "lib/MonoTouch10/_._", @@ -1136,8 +521,8 @@ ] }, "System.Linq/4.0.0": { - "type": "package", "sha512": "r6Hlc+ytE6m/9UBr+nNRRdoJEWjoeQiT3L3lXYFDHoXk3VYsRBCDNXrawcexw7KPLaH0zamQLiAb6avhZ50cGg==", + "type": "package", "files": [ "lib/dotnet/System.Linq.dll", "lib/net45/_._", @@ -1168,8 +553,8 @@ ] }, "System.Linq.Expressions/4.0.10": { - "type": "package", "sha512": "qhFkPqRsTfXBaacjQhxwwwUoU7TEtwlBIULj7nG7i4qAkvivil31VvOvDKppCSui5yGw0/325ZeNaMYRvTotXw==", + "type": "package", "files": [ "lib/DNXCore50/System.Linq.Expressions.dll", "lib/MonoAndroid10/_._", @@ -1202,8 +587,8 @@ ] }, "System.Linq.Queryable/4.0.0": { - "type": "package", "sha512": "DIlvCNn3ucFvwMMzXcag4aFnFJ1fdxkQ5NqwJe9Nh7y8ozzhDm07YakQL/yoF3P1dLzY1T2cTpuwbAmVSdXyBA==", + "type": "package", "files": [ "lib/dotnet/System.Linq.Queryable.dll", "lib/net45/_._", @@ -1234,8 +619,8 @@ ] }, "System.ObjectModel/4.0.10": { - "type": "package", "sha512": "Djn1wb0vP662zxbe+c3mOhvC4vkQGicsFs1Wi0/GJJpp3Eqp+oxbJ+p2Sx3O0efYueggAI5SW+BqEoczjfr1cA==", + "type": "package", "files": [ "lib/dotnet/System.ObjectModel.dll", "lib/MonoAndroid10/_._", @@ -1265,8 +650,8 @@ ] }, "System.Reflection/4.0.10": { - "type": "package", "sha512": "WZ+4lEE4gqGx6mrqLhSiW4oi6QLPWwdNjzhhTONmhELOrW8Cw9phlO9tltgvRUuQUqYtBiliFwhO5S5fCJElVw==", + "type": "package", "files": [ "lib/DNXCore50/System.Reflection.dll", "lib/MonoAndroid10/_._", @@ -1297,61 +682,9 @@ "System.Reflection.nuspec" ] }, - "System.Reflection.Emit.ILGeneration/4.0.0": { - "type": "package", - "sha512": "02okuusJ0GZiHZSD2IOLIN41GIn6qOr7i5+86C98BPuhlwWqVABwebiGNvhDiXP1f9a6CxEigC7foQD42klcDg==", - "files": [ - "lib/DNXCore50/System.Reflection.Emit.ILGeneration.dll", - "lib/net45/_._", - "lib/netcore50/System.Reflection.Emit.ILGeneration.dll", - "lib/wp80/_._", - "ref/dotnet/de/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/es/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/fr/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/it/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/ja/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/ko/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/ru/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/System.Reflection.Emit.ILGeneration.dll", - "ref/dotnet/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/zh-hans/System.Reflection.Emit.ILGeneration.xml", - "ref/dotnet/zh-hant/System.Reflection.Emit.ILGeneration.xml", - "ref/net45/_._", - "ref/wp80/_._", - "System.Reflection.Emit.ILGeneration.4.0.0.nupkg", - "System.Reflection.Emit.ILGeneration.4.0.0.nupkg.sha512", - "System.Reflection.Emit.ILGeneration.nuspec" - ] - }, - "System.Reflection.Emit.Lightweight/4.0.0": { - "type": "package", - "sha512": "DJZhHiOdkN08xJgsJfDjkuOreLLmMcU8qkEEqEHqyhkPUZMMQs0lE8R+6+68BAFWgcdzxtNu0YmIOtEug8j00w==", - "files": [ - "lib/DNXCore50/System.Reflection.Emit.Lightweight.dll", - "lib/net45/_._", - "lib/netcore50/System.Reflection.Emit.Lightweight.dll", - "lib/wp80/_._", - "ref/dotnet/de/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/es/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/fr/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/it/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/ja/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/ko/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/ru/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/System.Reflection.Emit.Lightweight.dll", - "ref/dotnet/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/zh-hans/System.Reflection.Emit.Lightweight.xml", - "ref/dotnet/zh-hant/System.Reflection.Emit.Lightweight.xml", - "ref/net45/_._", - "ref/wp80/_._", - "System.Reflection.Emit.Lightweight.4.0.0.nupkg", - "System.Reflection.Emit.Lightweight.4.0.0.nupkg.sha512", - "System.Reflection.Emit.Lightweight.nuspec" - ] - }, "System.Reflection.Extensions/4.0.0": { - "type": "package", "sha512": "dbYaZWCyFAu1TGYUqR2n+Q+1casSHPR2vVW0WVNkXpZbrd2BXcZ7cpvpu9C98CTHtNmyfMWCLpCclDqly23t6A==", + "type": "package", "files": [ "lib/DNXCore50/System.Reflection.Extensions.dll", "lib/net45/_._", @@ -1383,8 +716,8 @@ ] }, "System.Reflection.Primitives/4.0.0": { - "type": "package", "sha512": "n9S0XpKv2ruc17FSnaiX6nV47VfHTZ1wLjKZlAirUZCvDQCH71mVp+Ohabn0xXLh5pK2PKp45HCxkqu5Fxn/lA==", + "type": "package", "files": [ "lib/DNXCore50/System.Reflection.Primitives.dll", "lib/net45/_._", @@ -1416,8 +749,8 @@ ] }, "System.Reflection.TypeExtensions/4.0.0": { - "type": "package", "sha512": "YRM/msNAM86hdxPyXcuZSzmTO0RQFh7YMEPBLTY8cqXvFPYIx2x99bOyPkuU81wRYQem1c1HTkImQ2DjbOBfew==", + "type": "package", "files": [ "lib/DNXCore50/System.Reflection.TypeExtensions.dll", "lib/MonoAndroid10/_._", @@ -1449,8 +782,8 @@ ] }, "System.Resources.ResourceManager/4.0.0": { - "type": "package", "sha512": "qmqeZ4BJgjfU+G2JbrZt4Dk1LsMxO4t+f/9HarNY6w8pBgweO6jT+cknUH7c3qIrGvyUqraBhU45Eo6UtA0fAw==", + "type": "package", "files": [ "lib/DNXCore50/System.Resources.ResourceManager.dll", "lib/net45/_._", @@ -1482,8 +815,8 @@ ] }, "System.Runtime/4.0.20": { - "type": "package", "sha512": "X7N/9Bz7jVPorqdVFO86ns1sX6MlQM+WTxELtx+Z4VG45x9+LKmWH0GRqjgKprUnVuwmfB9EJ9DQng14Z7/zwg==", + "type": "package", "files": [ "lib/DNXCore50/System.Runtime.dll", "lib/MonoAndroid10/_._", @@ -1515,8 +848,8 @@ ] }, "System.Runtime.Extensions/4.0.10": { - "type": "package", "sha512": "5dsEwf3Iml7d5OZeT20iyOjT+r+okWpN7xI2v+R4cgd3WSj4DeRPTvPFjDpacbVW4skCAZ8B9hxXJYgkCFKJ1A==", + "type": "package", "files": [ "lib/DNXCore50/System.Runtime.Extensions.dll", "lib/MonoAndroid10/_._", @@ -1548,8 +881,8 @@ ] }, "System.Runtime.Handles/4.0.0": { - "type": "package", "sha512": "638VhpRq63tVcQ6HDb3um3R/J2BtR1Sa96toHo6PcJGPXEPEsleCuqhBgX2gFCz0y0qkutANwW6VPPY5wQu1XQ==", + "type": "package", "files": [ "lib/DNXCore50/System.Runtime.Handles.dll", "lib/MonoAndroid10/_._", @@ -1581,8 +914,8 @@ ] }, "System.Runtime.InteropServices/4.0.20": { - "type": "package", "sha512": "ZgDyBYfEnjWoz/viS6VOswA6XOkDSH2DzgbpczbW50RywhnCgTl+w3JEvtAiOGyIh8cyx1NJq80jsNBSUr8Pig==", + "type": "package", "files": [ "lib/DNXCore50/System.Runtime.InteropServices.dll", "lib/MonoAndroid10/_._", @@ -1614,8 +947,8 @@ ] }, "System.Text.Encoding/4.0.0": { - "type": "package", "sha512": "AMxFNOXpA6Ab8swULbXuJmoT2K5w6TnV3ObF5wsmEcIHQUJghoZtDVfVHb08O2wW15mOSI1i9Wg0Dx0pY13o8g==", + "type": "package", "files": [ "lib/MonoAndroid10/_._", "lib/MonoTouch10/_._", @@ -1662,8 +995,8 @@ ] }, "System.Threading/4.0.10": { - "type": "package", "sha512": "0w6pRxIEE7wuiOJeKabkDgeIKmqf4ER1VNrs6qFwHnooEE78yHwi/bKkg5Jo8/pzGLm0xQJw0nEmPXt1QBAIUA==", + "type": "package", "files": [ "lib/DNXCore50/System.Threading.dll", "lib/MonoAndroid10/_._", @@ -1695,8 +1028,8 @@ ] }, "System.Threading.Tasks/4.0.0": { - "type": "package", "sha512": "dA3y1B6Pc8mNt9obhEWWGGpvEakS51+nafXpmM/Z8IF847GErLXGTjdfA+AYEKszfFbH7SVLWUklXhYeeSQ1lw==", + "type": "package", "files": [ "lib/MonoAndroid10/_._", "lib/MonoTouch10/_._", From 44de4adcb70405e1cacd6a29eaebed8510362f4c Mon Sep 17 00:00:00 2001 From: Eric Swann Date: Wed, 20 Jan 2016 14:31:10 -0600 Subject: [PATCH 2/2] Added tests to show that some primitive types map with Explicit on while (enum) -> string fails --- src/Mapster/TypeAdapterConfig.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mapster/TypeAdapterConfig.cs b/src/Mapster/TypeAdapterConfig.cs index ff65111f..4b82b837 100644 --- a/src/Mapster/TypeAdapterConfig.cs +++ b/src/Mapster/TypeAdapterConfig.cs @@ -312,6 +312,9 @@ internal TypeAdapterSettings GetMergedSettings(Type sourceType, Type destination { if (this.RequireExplicitMapping && mapType != MapType.InlineMap && !MapContext.HasContext) { + if(sourceType.) + + if (!this.Dict.ContainsKey(new TypeTuple(sourceType, destinationType))) throw new InvalidOperationException( $"Implicit mapping is not allowed (check GlobalSettings.RequireExplicitMapping) and no configuration exists for the following mapping: TSource: {sourceType} TDestination: {destinationType}");