我有一个以Tag
导航属性(集合)命名的实体,名为Articles
. 有Tag
一个名为ignore-property ArticleCount
,用于保存相关联Article
的计数(仅在运行时和在视图中使用-被数据库忽略)。看:
public class Tag{
public int Id { get; set; }
public int Title { get; set; }
public virtual ICollection<Article> Articles { get; set; }
[NotMapped]
public int ArticleCount { get; set; }
}
如何在ONETag
查询中选择所有s (或一个),对 dataBase -in entity framework 4.1 code-first 进行查询,请使用 lambda 表达式?ArticleCount