What am I missing?
using Mapster;
using MapsterMapper;
TypeAdapterConfig config = new TypeAdapterConfig();
config.NewConfig<string?, bool?>().MapWith(src => Helper.ParseToNullableBool(src));
config.Compile();
Mapper mapper = new Mapper(config);
Source source = new Source { Prop1 = "yes" };
Destination destination = mapper.Map<Destination>(source);
Console.ReadLine();
static class Helper
{
public static bool? ParseToNullableBool(string? value)
{
if (string.IsNullOrWhiteSpace(value))
return null;
return value.Trim().ToLower() switch
{
"true" or "t" or "yes" or "1" => true,
"false" or "f" or "no" or "0" => false,
_ => null
};
}
}
class Source
{
public string? Prop1 { get; set; }
}
class Destination
{
public bool? Prop1 { get; set; }
}
converting non-nullable string to non-nullable bool works fine

What am I missing?
converting non-nullable string to non-nullable bool works fine