-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
In the following code i expected to come back with an Validation Error that "Utc" is not mapped.
But no Error is thrown.
#!/usr/bin/env dotnet-script
#r "nuget: AutoMapper, 13.0.1"
#r "nuget: AutoMapper.Extensions.EnumMapping, 3.2.0"
#nullable enable
using AutoMapper;
using System.Globalization;
using System.IO.Compression;
using System.Text.Json;
using AutoMapper.Extensions.EnumMapping;
enum TimeZoneSource
{
Local,
Utc,
Custom
}
enum TimeZoneTarget
{
Local,
Custom
}
var AutoMapperConfiguration = new MapperConfiguration(cfg =>
{
cfg.EnableEnumMappingValidation();
cfg.CreateMap<TimeZoneSource, TimeZoneTarget>(MemberList.Source)
.ConvertUsingEnumMapping(opt =>
{
opt.MapValue(TimeZoneSource.Local, TimeZoneTarget.Local);
opt.MapValue(TimeZoneSource.Custom, TimeZoneTarget.Custom);
});
});
AutoMapperConfiguration.AssertConfigurationIsValid();
Console.WriteLine("----End----");
Metadata
Metadata
Assignees
Labels
No labels