私のプロジェクトには次のシナリオがあり、それについていくつか質問があります。
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; }
}