我想使用自动映射器将模型集合映射到视图模型这是我的代码
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; }
}