c# - ADO.Net Entity framework object navigation? -
I am using the ADOnet entity framework and using C # to retrieve the language of a destination :
var list = Guava Context. Select dd.id_destination == destinationID from Destin dd; But when I use language in a foreign language:
foreach (expand destination details in the list) languages list. Add (extension .x_language); Details. The language is zero. Why?
Thank you!
What are the two tables: Destination and language? Is there a foreign key relationship between the destination and the language table?
This will help in commenting on the above problem of language's inefficient problem.
By default, EF does not retrieve the referenced table (lazy loading).
Try it:
Include in guiaContext.DestinationDetail in var list = dgu ("language") where dd.id_destination == destinationID selection dd;
Look at the eager loading in the entity framework at the following link:
Comments
Post a Comment