Created
August 30, 2013 10:21
-
-
Save JoachimL/6388443 to your computer and use it in GitHub Desktop.
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
public class Movie | |
{ | |
public int Id { get; set; } | |
public string Title { get; set; } | |
public ICollection<Actor> Actors { get;set; } | |
} | |
public class MovieModel | |
{ | |
public string Title { get; set; } | |
public string[] Actors { get; set; } | |
} | |
public class MovieToModelMapping : Profile | |
{ | |
Mapper.CreateMap<Movie, MoviePresentationModel>() | |
.ForMember(m => m.Actors, x => x.MapFrom(y => y.Actors.Select(a => a.Name))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment