Skip to content

Instantly share code, notes, and snippets.

@JoachimL
Created August 30, 2013 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoachimL/6388443 to your computer and use it in GitHub Desktop.
Save JoachimL/6388443 to your computer and use it in GitHub Desktop.
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