John Papa [MVP C#]

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Choosing an API to Talk to the Entity Framework

Diego Vega started me thinking about the differences between the different API's to the Entity Framework. I am currently doing a lot of writing about the Entity Framework and preparing many sessions on the topic so it obviously interests me :).  I had asked Diego about some of the differences between Entity SQL and using the strongly typed syntax of LINQ. He posted a quick list of some of the differences and similarities in this post today. (Thanks Diego)

That's a nice hit list of differences. I had not thought about how you can navigate with Entity SQL even without a Navigation property. Going further on this train of thought I figured I would post my interpretation of a similar question I get from people a lot.

In what situations would I choose 1 over the other?

The options being:

  1. Entity SQL with Entity Client
  2. Entity SQL with Object Services
  3. LINQ with Object Services

This is obviously an involved question/answer as the situation has to take into account several factors to make that determination. But overall here is a high level barometer you can use:

  • Entity SQL with Entity Client
    • when you need to read data and not write to it
    • when you need dynamic queries
  • Entity SQL with Object Services
    • when you need to retrieve entities you can interact with and persist, using a dynamic query
  • LINQ with Object Services
    • when you need to retrieve entities you can interact with and persist, using strongly typed syntax

 

I intentionally left this post very short as a means to help those who are just trying to wade through the deluge of information that is available on the Entity Framework. My general style is to keep blog posts to a quick and easily digestible piece of information. Deep dark details of topics I usually reserve for articles as I know personally when I read a blog post that goes on and on I start to lose focus ... which means I have a short attention span :)


Posted Thu, Dec 20 2007 10:44 AM by John Papa

[Advertisement]

Comments

Julie Lerman wrote re: Choosing an API to Talk to the Entity Framework
on Thu, Dec 20 2007 11:02 AM

Too bad you weren't able to stick around for my post-conference workshop at DevConnections. I spent 3 hours talking about exactly this! :-)

John Papa wrote re: Choosing an API to Talk to the Entity Framework
on Thu, Dec 20 2007 11:11 AM

Julie, Yeah, I was training in an ASP.NET class that day. It would have been nice to kick back and watch your session :-)

» Daily Bits - December 21, 2007 (Early Edition) Alvin Ashcraft’s Daily Geek Bits: Daily links plus random ramblings about development, gadgets and raising rugrats. wrote » Daily Bits - December 21, 2007 (Early Edition) Alvin Ashcraft’s Daily Geek Bits: Daily links plus random ramblings about development, gadgets and raising rugrats.
on Thu, Dec 20 2007 7:59 PM

Pingback from  » Daily Bits - December 21, 2007 (Early Edition) Alvin Ashcraft’s Daily Geek Bits: Daily links plus random ramblings about development, gadgets and raising rugrats.

Roger Jennings wrote re: Choosing an API to Talk to the Entity Framework
on Fri, Dec 21 2007 2:11 PM