1
iwant映射模型的集合視圖模型與automapper 到視圖模型,這是我的代碼地圖模型的集合與automapper
public class LanguageViewModel
{
public string Name { get; set; }
public IList<Word> Categories { set; get; }
public IList<string> PictureURL { set; get; }
}
,這我開始與模型
public class Word : BaseFieldsTables
{
public string Text { get; set; }
public virtual Category Category { get; set; }
public int CategoryID { get; set; }
public virtual Language Language { get; set; }
public int LanguageID { get; set; }
public virtual ICollection<Picture> Pictures { get; set; }
[InverseProperty("MainWord")]
public virtual ICollection<RelationshipBetweenWords> MainWords { get; set; }
[InverseProperty("RelatedWord")]
public virtual ICollection<RelationshipBetweenWords> RelatedWords { get; set; }
}
你能澄清所需的測繪工作的所有剩餘的內部集合?像Word.Language.Name - > LanguageViewModel.Name – k0stya
@Mohammad,你試過我的答案嗎? –