2010-10-12 231 views

回答

0

爲了您的收藏你需要做類似下面的東西(從一些代碼取我最近處理):

Mapper.CreateMap<List<QuizItemTypeModel>, List<Quiz.DataContracts.QuizItemType>>() 
       .Include<QuizDataCompositeModel, Quiz.DataContracts.QuizDataComposite>(); 

QuizDataCompositeModelQuiz.DataContracts.QuizDataComposite都擴展List<"RespectiveType">

0

這很簡單:

Mapper.CreateMap<DataSourceAreaConfigurationContract, DataSourceAreaConfiguration>(); 
Mapper.CreateMap<DataSourceConfigurationContract, DataSourceConfigurationContract>() 
     .ForMember(dest => dest.Areas, opt => opt.UseDestinationValue()); 

提示:下載源代碼並從給定的unittests和樣本中學習! 你可以在那裏找到它:http://automapper.codeplex.com/SourceControl/list/changesets