How is the .net Entity Framework overkill versus LinqToSql?

后端 未结 6 2355
暗喜
暗喜 2021-02-14 15:16

I\'ve heard it said that the Entity Framework is overkill or that it\'s difficult to learn compared to LinqToSql.

I am wondering in what way? I used LinqToSql and like

6条回答
  •  甜味超标
    2021-02-14 16:09

    Be careful though, LinqToEntities can do some really interesting things if you use queries with - for instance - group by. I have never managed to get LinqToEntities to transform a group by into an actual SQL group by, it instead generates some massive code blocks which can be really ineffective.

    For instance, check out the following link: http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/bb72fae4-0709-48f2-8f85-31d0b6a85f68

    If you attempt to write "non-trivial" queries, ObjectQuery.ToTraceString() is your best friend to make sure that EF doesn't do something really stupid behind your back.

提交回复
热议问题