Skip to content

Commit af9e784

Browse files
committed
- Changed reference to AutoMapper to the range [11.0, 12.0)
As a breaking change from version `11` onwards is dropped support for `net461` it seems unreasonable to keep support for this framework in the extension also. - Switched targets to only support `netstandard2.1` This is due to the fact that AutoMapper from version `11` has dropped support for `net461` target. Also removed optional dependencies, as package only target single framework now. - Switched targets for test project to `net6.0` Mainly because AutoMapper `11` targets `netstandard2.1` and this is not supported in `netcoreapp2.1`, also this target framework is no longer supported generally so updating seems like a good idea. Secondly I work on an Apple Silicon machine, so bumping to something compatible with .Net 6 was required for me to be able to run the tests. - Updated using statements to target `AutoMapper.Internal` when necessary - Use new `.Internal()` rather than old `.Advanced`
1 parent d87bfe0 commit af9e784

File tree

5 files changed

+9
-26
lines changed

5 files changed

+9
-26
lines changed

src/AutoMapper.Extensions.EnumMapping.Tests/AutoMapper.Extensions.EnumMapping.Tests.csproj

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net461;netcoreapp2.1;</TargetFrameworks>
3+
<TargetFramework>net6.0</TargetFramework>
44
<IsPackable>false</IsPackable>
55
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
66
</PropertyGroup>
@@ -24,17 +24,4 @@
2424
<ProjectReference Include="..\..\src\AutoMapper.Extensions.EnumMapping\AutoMapper.Extensions.EnumMapping.csproj" />
2525
</ItemGroup>
2626

27-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
28-
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
29-
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
30-
</ItemGroup>
31-
32-
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
33-
<Reference Include="Microsoft.CSharp" />
34-
</ItemGroup>
35-
36-
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
37-
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
38-
</ItemGroup>
39-
4027
</Project>

src/AutoMapper.Extensions.EnumMapping/AutoMapper.Extensions.EnumMapping.csproj

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Company>Henk Kin</Company>
66
<Summary>Convention-based enum value mapping extension for AutoMapper.</Summary>
77
<Description>Convention-based enum value mapping extension for AutoMapper.</Description>
8-
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
8+
<TargetFramework>netstandard2.1</TargetFramework>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1010
<AssemblyName>AutoMapper.Extensions.EnumMapping</AssemblyName>
1111
<AssemblyOriginatorKeyFile>..\..\AutoMapper.snk</AssemblyOriginatorKeyFile>
@@ -24,19 +24,12 @@
2424
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
2525
</PropertyGroup>
2626

27-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
27+
<ItemGroup>
28+
<PackageReference Include="AutoMapper" Version="[11.0, 12.0)" />
2829
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
2930
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" />
3031
</ItemGroup>
3132

32-
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
33-
<Reference Include="Microsoft.CSharp" />
34-
</ItemGroup>
35-
36-
<ItemGroup>
37-
<PackageReference Include="AutoMapper" Version="[10.0, 11.0)" />
38-
</ItemGroup>
39-
4033
<ItemGroup>
4134
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
4235
<PackageReference Include="MinVer" Version="2.3.0" PrivateAssets="All" />

src/AutoMapper.Extensions.EnumMapping/EnumMapperConfigurationExpressionExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Linq;
22
using AutoMapper.Extensions.EnumMapping.Internal;
3+
using AutoMapper.Internal;
34

45
namespace AutoMapper.Extensions.EnumMapping
56
{
@@ -14,7 +15,7 @@ public static class EnumMapperConfigurationExpressionExtensions
1415
/// <param name="mapperConfigurationExpression">Configuration object for AutoMapper</param>
1516
public static void EnableEnumMappingValidation(this IMapperConfigurationExpression mapperConfigurationExpression)
1617
{
17-
mapperConfigurationExpression.Advanced.Validator(context =>
18+
mapperConfigurationExpression.Internal().Validator(context =>
1819
{
1920
if (context.TypeMap != null)
2021
{

src/AutoMapper.Extensions.EnumMapping/Internal/EnumMappingValidationRuntimeFeature.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Text;
4+
using AutoMapper.Internal;
45

56
namespace AutoMapper.Extensions.EnumMapping.Internal
67
{
@@ -17,7 +18,7 @@ public EnumMappingValidationRuntimeFeature(Dictionary<TSource, TDestination> enu
1718
_enumMappingType = enumMappingType;
1819
}
1920

20-
public void Seal(IConfigurationProvider configurationProvider)
21+
public void Seal(IGlobalConfiguration configurationProvider)
2122
{
2223
}
2324

src/AutoMapper.Extensions.EnumMapping/Internal/IEnumMappingValidationRuntimeFeature.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using AutoMapper.Features;
2+
using AutoMapper.Internal;
23

34
namespace AutoMapper.Extensions.EnumMapping.Internal
45
{

0 commit comments

Comments
 (0)