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 a table called Room, this has a field called MasterRoomId, which self-references the Id field of the Room table. I have noticed that if I have room 105 set to reference room 101, if I look in Room.MasterRoom, the entity is correct. However, if I looad Entity for room101, the MasterRooms property (reverse reference) alwasy has a count of 0. I have set eager load on, and it has a value of 0, if I set eager load off, I get an exception if I try to read the count. I need to be able to traverse up and down the tree, but it seems I can only go one way, up.... Any idea how I can see what child rooms a room is related to? |
|
|
We don't support eager load to self (because on most databases there's no way to select indefinite hierarchies), but this should be falling back to lazy load or giving an error at model validation time, rather than giving you am incorrect count of 0. I'll look into this. With eager load turned off, however, this works fine when I test it: the child collection is lazy loaded and the count is correct. Can you provide us with details of the error you see with eager load off, and ideally a repro project? Thanks! |
|