I currently have a database consisting of many related objects.
Simplification with fewer objects:
Song => Versions => Info || \/ Data
Now I understand that I can load all these objects when using
db.Song.include("Versions.Data").Include("Versions.Info").ToList();
However, when I just want 1 song with its data, it will download all the songs and all the links.
Is there an easier way:
db.Song.First().include("Versions.Data").Include("Versions.Info")
Or do I really need to use:
Song.Versions.Load(); foreach( Version version in versions) { version.DataReference.Load(); version.InfoReference.Load(); }
This is doable if you have several related objects, but I have like 10 objects that also have subjects ...
Please show me the best way.
Peter source share