简体   繁体   中英

Automatic Query result in Entity-Framework

I have a database with lots of tables connected with a foreign keys. I use Entity Framework 6 with .NET 4.5 in Visual Studio.

I wanted to know if Entity Framework has an option to automatically return results by querying the main table for its ID and return all the results in JSON from all the connected tables including the main table. Is such option exists, considering that I need to query only based on the main table ID.

You are talking about Lazy Loading. I believe it is enable by default and you can check this example.

http://msdn.microsoft.com/en-us/data/jj574232.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM