public class Person { public string FirstName { get; set; } public string LastName { get; set; } } public class PersonDto { public string FullName { get; set; } } // Define a mapping between Person and PersonDto var config = new MapperConfiguration(cfg => { cfg.CreateMapIn this example, we define a mapping between a `Person` object and a `PersonDto` object, which contains only a `FullName` property derived from the `FirstName` and `LastName` properties of the `Person` object. We then create an instance of the `Mapper` class and use it to map a `Person` object to a `PersonDto` object. Other popular mapping libraries for C# include SimpleMapper, Mapster, and TinyMapper. These libraries offer similar functionality to AutoMapper, but may have different interfaces or performance characteristics.() .ForMember(dest => dest.FullName, opt => opt.MapFrom(src => $"{src.FirstName} {src.LastName}")); }); // Create a mapper instance var mapper = new Mapper(config); // Map a Person object to a PersonDto object var person = new Person { FirstName = "John", LastName = "Doe" }; var personDto = mapper.Map (person); Console.WriteLine(personDto.FullName); // "John Doe"