Created
September 5, 2019 13:04
-
-
Save johnmmoss/45cafa62b18b7fb479a38448af07f473 to your computer and use it in GitHub Desktop.
AutoMapper sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static CustomerDto Map(Customer customerEntity) | |
{ | |
var config = new MapperConfiguration(cfg => cfg.CreateMap<Customer, CustomerDto>()); | |
var mapper = new Mapper(config); | |
return mapper.Map<CustomerDto>(customerEntity); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment