This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have two questions regarding EagerLoad. 1. Can EagerLoad be setup to load many child tables. Lets say I have a product table and it has attributes and also colors. Can it be setup to load both tables? 2. Can EagerLoad be setup to load tables 2 or more relationships deep? Lets say I have a product table and a many to many table called productsizes is associated. I would like to load the product, all of the productsize relationships and the size table (many records). On top of that, Size has a sub table; I would like to load that also. Can this be done? I have another question about foreign keys. There are times where I just need the foreign key id to populate a link. I don't want to have to eager load the related table to obtain the id. Do I have access to the raw ID? An example would be an order detail table. I don't want to have to load the order table just to obtain the orderid. Thank you, Joe Feser |
|
|
1. Can EagerLoad be set up to load many child tables? Yes. Just set Eager Load Collection / Eager Load Backreference on, or apply EagerLoadAttribute in code to, each association you want to be eager loaded. 2. Can EagerLoad be set up to load tables two or more relationships deep? Yes. 3. Can I get a foreign key ID without eager loading the related table? Yes. The backreference (many-to-one) direction of an association generates two properties: Order (in your example), the related entity, and OrderId, the related entity's ID. OrderId will always be loaded when you load the OrderDetail entity, just like an normal primitive property; Order will be be loaded (from the Orders table) only when you access the Order property (unless it is marked for eager load, or you performed the OrderDetail with a named aggregate that included the Order association). |
|