私には2つのエンティティがあります:StudentとClassです。
それらは互いに多対多の関係にあります:
class Student
{
ICollection<Class> Classes{get;set;}
}
class Class
{
ICollection<Student> Students{get;set;}
}
次のステートメントを実行しようとすると:
return _db.Students.Where(s => s.Email == email).FirstOrDefault();
このエラーメッセージが表示されます:
"The context cannot be used while the model is being created."