Switching to LINQ

后端 未结 5 1662
花落未央
花落未央 2021-02-09 19:15

I\'m considering spending time learning and using LINQ to SQL but after years of best practices advising NOT to embed SQL I\'m having a hard time changing paradigms.

Why

5条回答
  •  后悔当初
    2021-02-09 20:03

    I undertand your point, this does indeed seem like a bit of a backward step...

    Actually I would probably steer away from LINQ to SQL and look more at LINQ to Entities, your entities model your conceptual data model and I personaly feel more comfortable embedding queries agains a conceptual model in my code. The actual physical model is abstracted away from you by an entity framework.

    This link (excuse the pun) discusses LINQ to Entities and the Entity Framework: http://msdn.microsoft.com/en-us/library/bb386992.aspx

    This is an interesting article discussign the pros and cons of both approaches: http://dotnetaddict.dotnetdevelopersjournal.com/adoef_vs_linqsql.htm

    Edit Another thought, if you don't want wait for EF, have a look at NHibernate, you can LINQ to that too... See http://www.hookedonlinq.com/LINQToNHibernate.ashx

提交回复
热议问题