There are two classes:

public class UserDTO { public Guid Id { get; set; } public int DivisionId { get; set; } } public class User { public Guid Id { get; set; } public int DivisionID { get; set; } } 

Please tell me how to set the ignore case in AutoMapper settings so that the DivisionID properties can be converted to DivisionId.

    1 answer 1

    Ignore case is the default behavior for AutoMapper since about 2013 .

     private static void Main(string[] args) { Mapper.CreateMap<User, UserDTO>(); var user = new User { Id = Guid.NewGuid(), DivisionID = 1 }; var map = Mapper.Map<UserDTO>(user); Console.WriteLine(map.DivisionId); } 

    1 will be displayed on the console, i.e. The DivisionID field is mapped to the DivisionId .

    In your case, the problem is solved by updating to the current version.