Created
January 10, 2020 16:59
-
-
Save sumitkharche/87c582a9d5eb3b42e7c92db507800627 to your computer and use it in GitHub Desktop.
Automapper.cs with projection
This file contains 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
namespace automapper_sample | |
{ | |
public class AutoMapperProfile : Profile | |
{ | |
public AutoMapperProfile() | |
{ | |
CreateMap<StudentDTO, Student>() | |
.ForMember(dest => dest.City, opt => opt.MapFrom(src => src.CurrentCity)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment