Home > Net > Using c # to the Entity Framework of lazy loading of a little doubt, seek to reassure
Using c # to the Entity Framework of lazy loading of a little doubt, seek to reassure
Time:09-30
Use EF6 query the database data, the results of a query is not the same as expected, the database structure is simple, data types are all int,
Query twice, using different keyword query, the query results is the same, the second query the first covers the results of the query, the query code as shown in figure,
But if you use the picture comment out code query, coverage, will happen at the time of debugging is also found that, with the current code debugging, found out the results of the query enumeration is normal for the first time, but the second query again after the result of the enumeration result is found for the first time is wrong, this should be related to EF of lazy loading, but I understand lazy loading should at least give recorded the query expression, how can regenerate the expression in the query time? So a bit worried about the code before a similar problem,