I am debugging a piece of code which is using EF as ORM. Now, I am seeing somewhat interesting behavior from the application:
This is the code where I'm calling a stored procedure:
List<RequestListEntity> results = new List<RequestListEntity>();
var temp = System.Data.Object.ObjectContext.ExecuteFunction<T>("storedProcedure", param);
foreach (var item in temp)
{
results.Add(item);
}
Observations:
objectResult<T>
with a total of 1000 entries. Now this raises a lot of questions:
The performance issue is because of lazy loading and object tracking. when this method called result maps to an entity type, two things happen that don't happen when context.Database.SqlQuery is executed :
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.