我的项目中有以下场景,我开始遇到一些关于它的问题。
在User课堂上,QuestionFollows直接查询会比查询更好(就性能而言)Questions然后QuestionFollows?
User另一个问题……和QuestionFollow必要/冗余之间的关系是什么?
领域
public class User
{
public long UserID { get; set; }
public string Name { get; set; }
public virtual ICollection<Question> Questions { get; set; }
public virtual ICollection<QuestionFollow> QuestionFollows { get; set; }
}
public class Question
{
public long QuestionID { get; set; }
public long UserID { get; set; }
public string Description { get; set; }
public User User { get; set; }
public virtual ICollection<QuestionFollow> QuestionFollows { get; set; }
}
public class QuestionFollow
{
public long QuestionFollowID { get; set; }
public long QuestionID { get; set; }
public long UserID { get; set; }
public DateTime Date { get; set; }
public Question Question { get; set; }
public User User { get; set; }
}