Hello,
i have an entity named "RWork" with following structure:
ID NUMERIC
NAME VARCHAR2
Parent RWork
underlying Database table
--------------------------------
1 Grandfather NULL
2 Father 1
3 Fathers Sister 1
4 Child 3
And now, when i try:
from f in model.RWork
where f.RWork.ID.Equals(4)
select f
i get an Object of RWork (4, "Child", NULL) --> without Parent-object
what i must do, that i get an object of type RWork (4, "Child", RWork)
thanks, Daniel
Entity with include parent object (hirarchical)
-
- Posts: 10
- Joined: Wed 10 Mar 2010 13:20
Try the following code:
In case it doesn't help, please send us (support * devart * com, subject "EF Lazy Loading") a small test project illustrating your scenario.
Code: Select all
from f in model.RWork.Include("Parent")
where f.RWork.ID.Equals(4)
select f
-
- Posts: 10
- Joined: Wed 10 Mar 2010 13:20
...
Thank you, it works!
You rescue my life, we are so in schedule pressure
You rescue my life, we are so in schedule pressure