Skip to content

Commit 8eb3e89

Browse files
committed
Upgrade reference to AutoMapper 12
1 parent 21b3eb0 commit 8eb3e89

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</PropertyGroup>
2727

2828
<ItemGroup>
29-
<PackageReference Include="AutoMapper" Version="[11.0, 13.0)" />
29+
<PackageReference Include="AutoMapper" Version="[12.0, 13.0)" />
3030
</ItemGroup>
3131

3232
<ItemGroup>

src/AutoMapper.Extensions.EnumMapping/EnumMapperConfigurationExpressionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static void EnableEnumMappingValidation(this IMapperConfigurationExpressi
1919
{
2020
if (context.TypeMap != null)
2121
{
22-
var validator = context.TypeMap.Features.OfType<IEnumMappingValidationRuntimeFeature>().SingleOrDefault();
22+
var validator = context.TypeMap.Features.Get<IEnumMappingValidationRuntimeFeature>();
2323
validator?.Validate(context.TypeMap.Types);
2424
}
2525
});

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public void Configure(TypeMap typeMap)
2121
throw new ArgumentException($"The type {typeMap.SourceType.FullName} can not be configured as an Enum, because it is not an Enum");
2222
}
2323

24-
if (!typeMap.DestinationTypeToUse.IsEnum)
24+
if (!typeMap.DestinationType.IsEnum)
2525
{
26-
throw new ArgumentException($"The type {typeMap.DestinationTypeToUse.FullName} can not be configured as an Enum, because it is not an Enum");
26+
throw new ArgumentException($"The type {typeMap.DestinationType.FullName} can not be configured as an Enum, because it is not an Enum");
2727
}
2828

29-
var enumValueMappings = CreateOverridedEnumValueMappings(typeMap.SourceType, typeMap.DestinationTypeToUse);
29+
var enumValueMappings = CreateOverridedEnumValueMappings(typeMap.SourceType, typeMap.DestinationType);
3030

3131
typeMap.CustomMapExpression = new CustomMapExpressionFactory<TSource, TDestination>(enumValueMappings).Create();
3232
typeMap.Features.Set(new EnumMappingValidationRuntimeFeature<TSource, TDestination>(enumValueMappings, EnumMappingType));

0 commit comments

Comments
 (0)