Letters from Readers

A Question About the Entity Framework

A Question About the Entity Framework
Is the Entity Framework a good replacement for Store Procedures?

Ray Akkanson
Ohio

Lennie Lobel, CTO of Sleek Technologies and a consultant at twentysix New York, is an expert on Entity Framework and Microsoft .NET Framework data-access technologies. He provided insight for the recent cover story on the Entity Framework ("Get Ready for the Entity Framework," September 2010). Here, he offers a response to Akkanson's question:

That's a loaded question, so I'll try to drive the key points. In scenarios where you "own" the back-end and have total control over its tables and permissions (which your question pre-supposes), the Entity Framework can be an excellent alternative to stored procedures, particularly for selects. The T-SQL generated dynamically at runtime is much improved from version 1, and while there's room for improvement, in most cases the Entity Framework generates perfectly adequate T-SQL. So, you can enjoy the power of the Entity Framework by using LINQ to Entities against the conceptual model and allowing the runtime to handle the exact SQL against the database. Furthermore, you can easily import specialized stored procedures into your model for cases when you need to, so it's not an all-or-nothing prospect.

Keeping It Not-Too-Simple
In his Redmond Review blog, Andrew J. Brust wrote about LightSwitch and other simple programming tools recently introduced by Microsoft ("Microsoft's New Tools: Harmony or Cacophony?" Aug. 13, 2010). He wrote that the challenge now is making these solutions work together. A reader responds:

I'm gratified to see [Brust] commenting on how many versions of SQL Server there are and how different development tools target different SQL Server versions. It's nothing new. There was ASP.NET 2.0 targeting the SQL Server Developer Edition, which had different connection strings and different project-type support. It caused me a lot of trouble with my Visual Studio 2005 Web projects when I upgraded to SQL Server 2005 Standard Edition. [Brust is] right to point it out and say they should clean that up!

L.G.
New England

Praise for C# Corner
In his August C# Corner column, "Inversion of Control Patterns for the Microsoft .NET Framework," Patrick Steele explored Inversion of Control (IOC) containers and Dependency Injection (DI). A reader responds:

As a noob programmer, this is one of the best articles about IOC and DI that I've come upon. It really helped to solidify my fragile understanding of IOC and DI. Thanks!

Al
Atlanta, Ga.

About the Author

This story was written or compiled based on feedback from the readers of Visual Studio Magazine.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube