I found that I do not need to add explicit DbSet properties to the DbContext for each class, because EF automatically adds all related classes to the model.
I can be lazy and add only explicit properties for some classes, and then refer to any other classes using the DbContext.Set <> () method:
var q = from x in myContext.Set<myClass>() select x;
source
share