another Entity Framework question (ADO.NET) from me. I use EF1 (there is no choice) and there is a MySQL database as the database.
A simple question: I can not find a satisfactory answer for:
What exactly do I need to do to download? IE., When I have an entity and you want to list its children, let's say that I have Entity "Group" and it has a child "User" and I want to make "from n to g.Users, where n .UserID = 4 select n ", first I need to call g.Users.Load ();
This is a little annoying because when I make a request against an unloaded collection, I would expect EF to load it automatically - will AT LEAST throw an exception, and not just return 0 results?
Another case when I have to take care of the download: I have a request:
from n in Users where n.Group.Name == "bla" select n
For some reason, it fails by nulling a pointer to n.Group, although n.GroupID (the key for the group) is set correctly. In addition, when I did Server.Groups.Load () before (groups are children of one server), it works.
Is there any specific policy on when to call Load () which collection?
Thanks again Michael
source
share