LINQ To Entities and Lazy Loading

前端 未结 6 1645
谎友^
谎友^ 2020-12-28 23:45

In a controversial blog post today, Hackification pontificates on what appears to be a bug in the new LINQ To Entities framework:

Suppose I search fo

6条回答
  •  感情败类
    2020-12-29 00:26

    Even though you shouldn't have to know about Microsoft's internal development teams and processes, fact of the matter is that these two technologies are two completely different beasts.

    The design decision for LINQ to SQL was, for simplicity's sake, to implicitly lazy-load collections. The ADO.NET Entity Framework team didn't want to execute queries without the user knowing so they designed the API to be explicitly-loaded for the first release.

    LINQ to SQL has been handed over to ADO.NET team and so you may see a consolidation of APIs in the future, or LINQ to SQL get folded into the Entity Framework, or you may see LINQ to SQL atrophy from neglect and eventually become deprecated.

提交回复
热议问题