Automapper Documentation Code Example


Example: c# mapper.map


var config = new MapperConfiguration(cfg => {                cfg.CreateMap<AuthorModel, AuthorDTO>();            });IMapper iMapper = config.CreateMapper();var source = new AuthorModel();source.Id = 1;source.FirstName = "Joydip";source.LastName = "Kanjilal";source.Address = "India";var destination = iMapper.Map<AuthorModel, AuthorDTO>(source);Console.WriteLine("Author Name: "+ destination.FirstName + " " + destination.LastName);

Comments

Popular posts from this blog

530 Valid Hostname Is Expected When Setting Up IIS 10 For Multiple Sites

C Perror Example

Converting A String To Int In Groovy