From 4c8713ed8751d7d4b9d55ad77e5395cd3752d66a Mon Sep 17 00:00:00 2001 From: Gary Woodfine Date: Sun, 5 Jan 2020 21:22:57 +0000 Subject: [PATCH 1/2] tidy up before upgrade --- Threenine.Map.sln | 2 +- .../DomainObjects/ComplexDomainObject.cs | 0 .../DomainObjects/DomainObjects.csproj | 0 .../DomainObjects/SimpleDomainObject.cs | 0 .../EntityObjects/EntityObjects.csproj | 22 ++++++++--------- .../EntityObjects/SimpleEntity.cs | 24 +++++++++---------- .../MapperTests/ComplexDomainObjectTests.cs | 0 .../MapperTests/MapperFixture.cs | 0 .../MapperTests/MapperTests.csproj | 0 .../MapperTests/SimpleDomainObjectTests.cs | 0 .../MapperTests/TestCollection.cs | 0 website/website.md | 0 12 files changed, 24 insertions(+), 24 deletions(-) rename {UnitTests => tests}/DomainObjects/ComplexDomainObject.cs (100%) rename {UnitTests => tests}/DomainObjects/DomainObjects.csproj (100%) rename {UnitTests => tests}/DomainObjects/SimpleDomainObject.cs (100%) rename {UnitTests => tests}/EntityObjects/EntityObjects.csproj (95%) rename {UnitTests => tests}/EntityObjects/SimpleEntity.cs (94%) rename {UnitTests => tests}/MapperTests/ComplexDomainObjectTests.cs (100%) rename {UnitTests => tests}/MapperTests/MapperFixture.cs (100%) rename {UnitTests => tests}/MapperTests/MapperTests.csproj (100%) rename {UnitTests => tests}/MapperTests/SimpleDomainObjectTests.cs (100%) rename {UnitTests => tests}/MapperTests/TestCollection.cs (100%) delete mode 100644 website/website.md diff --git a/Threenine.Map.sln b/Threenine.Map.sln index 4629707..642e523 100644 --- a/Threenine.Map.sln +++ b/Threenine.Map.sln @@ -4,7 +4,7 @@ VisualStudioVersion = 15.0.27130.2027 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Threenine.Map", "src\Threenine.Map.csproj", "{1CDD5884-E7D3-435B-B0FC-30DAC41B3B94}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{1F5C8EB2-12EE-4ACE-9084-1F9C4474CC84}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1F5C8EB2-12EE-4ACE-9084-1F9C4474CC84}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapperTests", "UnitTests\MapperTests\MapperTests.csproj", "{9BF2645A-007C-4402-9AAB-08F813CBF680}" EndProject diff --git a/UnitTests/DomainObjects/ComplexDomainObject.cs b/tests/DomainObjects/ComplexDomainObject.cs similarity index 100% rename from UnitTests/DomainObjects/ComplexDomainObject.cs rename to tests/DomainObjects/ComplexDomainObject.cs diff --git a/UnitTests/DomainObjects/DomainObjects.csproj b/tests/DomainObjects/DomainObjects.csproj similarity index 100% rename from UnitTests/DomainObjects/DomainObjects.csproj rename to tests/DomainObjects/DomainObjects.csproj diff --git a/UnitTests/DomainObjects/SimpleDomainObject.cs b/tests/DomainObjects/SimpleDomainObject.cs similarity index 100% rename from UnitTests/DomainObjects/SimpleDomainObject.cs rename to tests/DomainObjects/SimpleDomainObject.cs diff --git a/UnitTests/EntityObjects/EntityObjects.csproj b/tests/EntityObjects/EntityObjects.csproj similarity index 95% rename from UnitTests/EntityObjects/EntityObjects.csproj rename to tests/EntityObjects/EntityObjects.csproj index 34824bd..7ac1b71 100644 --- a/UnitTests/EntityObjects/EntityObjects.csproj +++ b/tests/EntityObjects/EntityObjects.csproj @@ -1,11 +1,11 @@ - - - - netstandard2.0 - - - - - - - + + + + netstandard2.0 + + + + + + + diff --git a/UnitTests/EntityObjects/SimpleEntity.cs b/tests/EntityObjects/SimpleEntity.cs similarity index 94% rename from UnitTests/EntityObjects/SimpleEntity.cs rename to tests/EntityObjects/SimpleEntity.cs index 9fa413a..a602824 100644 --- a/UnitTests/EntityObjects/SimpleEntity.cs +++ b/tests/EntityObjects/SimpleEntity.cs @@ -1,12 +1,12 @@ -using System; - - -namespace EntityObjects -{ - public class SimpleEntity - { - public string Name { get; set; } - public string Description { get; set; } - public int Age { get; set; } - } -} +using System; + + +namespace EntityObjects +{ + public class SimpleEntity + { + public string Name { get; set; } + public string Description { get; set; } + public int Age { get; set; } + } +} diff --git a/UnitTests/MapperTests/ComplexDomainObjectTests.cs b/tests/MapperTests/ComplexDomainObjectTests.cs similarity index 100% rename from UnitTests/MapperTests/ComplexDomainObjectTests.cs rename to tests/MapperTests/ComplexDomainObjectTests.cs diff --git a/UnitTests/MapperTests/MapperFixture.cs b/tests/MapperTests/MapperFixture.cs similarity index 100% rename from UnitTests/MapperTests/MapperFixture.cs rename to tests/MapperTests/MapperFixture.cs diff --git a/UnitTests/MapperTests/MapperTests.csproj b/tests/MapperTests/MapperTests.csproj similarity index 100% rename from UnitTests/MapperTests/MapperTests.csproj rename to tests/MapperTests/MapperTests.csproj diff --git a/UnitTests/MapperTests/SimpleDomainObjectTests.cs b/tests/MapperTests/SimpleDomainObjectTests.cs similarity index 100% rename from UnitTests/MapperTests/SimpleDomainObjectTests.cs rename to tests/MapperTests/SimpleDomainObjectTests.cs diff --git a/UnitTests/MapperTests/TestCollection.cs b/tests/MapperTests/TestCollection.cs similarity index 100% rename from UnitTests/MapperTests/TestCollection.cs rename to tests/MapperTests/TestCollection.cs diff --git a/website/website.md b/website/website.md deleted file mode 100644 index e69de29..0000000 From 0be091ed89b9e55862a68298521d79968c33f1bd Mon Sep 17 00:00:00 2001 From: Gary Woodfine Date: Sun, 5 Jan 2020 22:56:13 +0000 Subject: [PATCH 2/2] updated automapper to 8.1.0 --- README.md | 4 ++++ Threenine.Map.sln | 6 +++--- src/MapConfigurationFactory.cs | 5 ++++- src/Threenine.Map.csproj | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2deaccb..43b5052 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ or using the Dotnet Core CLI `dotnet add package Threenine.Map` +The package will install Automapper 8.1.0. + +*** Do not attempt to use the library with Automapper 9.X + breaking with the removal of the static API + ## Documentation We are currently compiling comprehensive documentation and examples of use of available on [Threenine.Map - Read the Docs](http://threeninemap.readthedocs.io/en/latest/Getting-started.html). diff --git a/Threenine.Map.sln b/Threenine.Map.sln index 642e523..05aa40e 100644 --- a/Threenine.Map.sln +++ b/Threenine.Map.sln @@ -6,11 +6,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Threenine.Map", "src\Threen EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1F5C8EB2-12EE-4ACE-9084-1F9C4474CC84}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapperTests", "UnitTests\MapperTests\MapperTests.csproj", "{9BF2645A-007C-4402-9AAB-08F813CBF680}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapperTests", "tests\MapperTests\MapperTests.csproj", "{9BF2645A-007C-4402-9AAB-08F813CBF680}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DomainObjects", "UnitTests\DomainObjects\DomainObjects.csproj", "{8A8B8DD5-7961-49C6-A2A9-F91954236396}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DomainObjects", "tests\DomainObjects\DomainObjects.csproj", "{8A8B8DD5-7961-49C6-A2A9-F91954236396}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityObjects", "UnitTests\EntityObjects\EntityObjects.csproj", "{36A8C934-D5DB-4153-86D3-DC8975421E78}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EntityObjects", "tests\EntityObjects\EntityObjects.csproj", "{36A8C934-D5DB-4153-86D3-DC8975421E78}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/MapConfigurationFactory.cs b/src/MapConfigurationFactory.cs index 8b8ba40..66c72d2 100644 --- a/src/MapConfigurationFactory.cs +++ b/src/MapConfigurationFactory.cs @@ -24,7 +24,7 @@ public static void Scan(Func assemblyFilter = null) LoadMapsFromAssemblies(assembliesToLoad.ToArray()); } - public static void LoadMapsFromAssemblies(params Assembly[] assemblies) + private static void LoadMapsFromAssemblies(params Assembly[] assemblies) { var types = assemblies.SelectMany(a => a.GetExportedTypes()).ToArray(); LoadAllMappings(types); @@ -33,6 +33,9 @@ public static void LoadMapsFromAssemblies(params Assembly[] assemblies) public static void LoadAllMappings(IList types) { + + + Mapper.Initialize( cfg => { diff --git a/src/Threenine.Map.csproj b/src/Threenine.Map.csproj index fd0962b..ea6cbe2 100644 --- a/src/Threenine.Map.csproj +++ b/src/Threenine.Map.csproj @@ -23,7 +23,7 @@ - +