Today I'm mapping my objects to DTO like this.
public IEnumerable<ArticleDTO> GetArticlesBasedOnCategorySection(int catSection, int headCategoryID, string customerREFID)
{
return _articleRepository.GetArticlesByCategory(catSection, headCategoryID, customerREFID).Select(a => Mapper.ToDTO(a)).ToList();
}
But inside the variable I have another list that I want to map in a similar way.
Is it possible to write this all in one line like this or do I have to write an foreach loop then map a.List.