I know there are a lot of questions (and answers) about this BUT none of these works for me when using .net6 and automapper 11.01.1
They seem to have removed many of these Ignore, IgnoreAllUnmapped and ForAllOtherMembers in the latest automapper.
If I use ignore with ForAllMembers (before or after ForMember) it will ignore all fields, even those I specify with a map.
The problem: I have two classes with fields with the same name, but I only want to map a few and ignore the rest. (please don't say "why do you need automapper" that's not the question here).
I need to use automapper in this case but not sure if they support this anymore? Am I missing a nuget maybe? I only use the "AutoMapper 11.01.1"
public class User1
{
    public string Name { get; set; } = "Foo";
    public int Age { get; set; } = 7;
    public string Phone { get; set;} = "123456789";
}
public class User2
{ 
    public string FirstLastName { get; set; }
    public int Age { get; set; }
    public string Phone { get; set; }
}
public class AutoMapperProfile : Profile
{
    public AutoMapperProfile()
    {
        CreateMap<User1, User2>()
            .ForMember(dest => dest.FirstLastName, opt => opt.MapFrom(src => src.Name))
            //.ForMember(dest => dest.Age, src => src.Ignore());  // works BUT I do not want to ignore every field manually
            //.ForAllMembers(dest => dest.Ignore())               // doesn't work, clears all fields
            //.ValidateMemberList(MemberList.None)                // doesn't work
            ;
    }
}
void Main()
{
    var user1 = new User1();
    
    var config = new MapperConfiguration(mc => mc.AddProfile(new AutoMapperProfile()));
    Mapper mapper = new Mapper(config);
    
    var user2 = mapper.Map<User2>(user1);
    user2.Dump();
}
 
     
     
    