Data Driver

Blog archive

Entity Framework Gets Code First (but Not Enum Support!)

No need to wait for that next major .NET Framework upgrade to get Entity Framework improvements, as a stand-alone EF installer is about to be released for the first time.

Entity Framework CTPs have been out for months and have alleviated many user concerns, and Entity Framework 4.1 is due to arrive any week now to address more.

It includes two major components: a DbContext API and Code First capability. The former is basically a simplified and enhanced ObjectContext. Most of the buzz among developers is around the new Code First component.

"Code First alleviates any need for a visual model, you can just create your classes, add any needed configurations to make sure they align with EF rules and go," said EF expert and author Julie Lerman in an interview. "You get the benefits of the ORM [object relational mapping] features offered by EF without the extra layer of having to create your model in a designer and then futz with a code generator to get your classes the way you want them."

Alleviation of the futz factor is a definite plus, indicated Tim Laverty, who as the lead program manager on the Microsoft EF team probably knows as much about Entity Framework as anyone in the world. In an interview, Laverty said Code First "offers a way for 'code-oriented' customers to build EDM [Entity Data Models] models and use EF.  Previously, tooling or a command-line interface was required to create your model unless you were willing to create and edit complex XML files."

Laverty also mentioned that EF 4.1 supplies several conventions, such as database creation, to help developers build apps easier, and also has rich ASP.NET MVC integration.

And developers are likely to be excited about the new DbContext API, too, said Lerman, who wrote a preview of EF 4.1 in MSDN Magazine [full disclosure: my day job is features editor for the mag]. "It's not just that the amount of exposed properties and methods has been reduced," she told this site, "but there are a lot of coding tasks that have been simplified … whereas you have to do a little more juggling with ObjectContext to achieve the same ends."

While many developers lauded the new release when it was announced last week, there's still a big list of improvements they want, such as support for stored procedures, type conversions, enums, bulk updates and more.

"Darn it! No SP support? Cached queries? Very disappointing," said a user named Darius in the comment section of the ADO.NET team blog announcing the "Go-Live Release Candidate." "Guess we'll have to wait a bit longer to use this.  Please just make sure that when you do implement, you do it right. Needs SPs to map to POCO objects or maybe even dynamic objects. Same goes for an ad-hoc SQL query."

Laverty sounded like he's heard about the enum clamor before. "Enum support!" he exclaimed when asked about future improvements (it's actually No. 1 on the uservoice site list, with more than 1,200 requests). "This is our top ask and is in our product plan for vNext," Laverty said. "After that, there's a large backlog: TVF [Table-Valued Function] support, Spatial support, better integration with database projects … better SQL gen, batch CUD [create, update or delete], second-level cache support, sharding support, migrations/database evolution, better [stored procedures] support" and more.

Laverty noted that disassociating EF from the evolution of Visual Studio and .NET Framework releases will help the EF team get improvements out faster--hopefully once per year. "We don't have a locked date for the release after 4.1 but are working on it now," he said.

He said you can let Microsoft know what features you'd like to see in EF in three main ways. "Give us feedback on our uservoice site, our forums, and our blog, please. We actively use each to build and prioritize our product backlog."

What would you like to see done to Entity Framework? Comment here or drop me a note.

Posted by David Ramel on 03/09/2011 at 1:15 PM


comments powered by Disqus

Reader Comments:

Tue, Feb 18, 2014

http://www.theworkflowelement.com/consumer-technology/o DOT ffice-supply-stores-in-canada-industry-market-research-report-from-ibisworld-has-been-updated.html http://www.reginejohansen.com/flood-insurance/f DOT lood-property-insurance.html http://spring.me/G DOT oRate http://www.eschatologyjournal.org/national-health-insurance/l DOT atest-national-health-insurance-auctions.html http://www.preservationvision-nyc.org/discount-car-insurance/l DOT atest-discount-car-insurance-auctions-3.html http://www.thesuninmotion.net/solar-energy-market/l DOT atest-solar-energy-market-news-4.html

Thu, Feb 13, 2014

http://www.evansvillecommunitytheatre.com/ DOT http://w DOT ww.carcoveragebrokers.com http://www.insurecaronline.com/ DOT http://www.msugcf.org/ DOT http://w DOT ww.comparelifeinsurancedeals.com http://www.joyofslowcommunication.com/p DOT rednisone.html

Sun, Feb 2, 2014

http://www.propertyplant.com/ DOT http://www.edtreatmentforyou.com/ DOT http://www.naturalcosmeticandskincare.org/ DOT http://www.edpillsfinder.com/ DOT http://www.racheltatum.com/ DOT http://www.insurecaronline.com/ DOT

Tue, Jan 28, 2014

http://larsbolanderblog.com/b DOT lackjack.html http://a DOT rtilleries.org http://w DOT ww.mylifeinsuranceguide.net http://w DOT ww.healthinsurancebible.com http://w DOT ww.businessinsurrates.com http://www.healthinsurcover.com/ DOT http://w DOT ww.cheapinsurancemate.com

Sat, Jan 25, 2014

http://w DOT ww.medspricechart.com http://w DOT ww.healthinsur.net http://w DOT ww.smallbusinessinsurers.com http://www.mybestinsurancequotes.net/ DOT http://www.healthinsurcover.com/ DOT http://w DOT ww.medinsurers.com

Tue, Jan 21, 2014

http://w DOT ww.autoprotectionoptions.com http://w DOT ww.protectionrates.net http://w DOT ww.gettopedmeds.com http://www.forgetyoured.net/ DOT http://w DOT ww.findairflights.com

Sat, Jan 18, 2014

http://w DOT ww.cheapairflights4you.com http://w DOT ww.gettopedmeds.com http://w DOT ww.starcraft2-wiki.com http://w DOT ww.smallbusinessinsurers.com http://www.mycheapinsuranceonline.com/ DOT

Fri, Dec 6, 2013 Tan Please keep thwriong these posts up they help tons.

Please keep http://h DOT homoavgy.com these posts up they help tons.

Thu, Dec 5, 2013 Miranah IJWTS wow! Why can't I think of thngis like that?

IJWTS wow! Why can't I think of thngis like that?

Thu, Mar 10, 2011

I first worked with EF for .NET 4 and loved it. Then, when I took a new job, I had to "downshift" to EF for .NET 3.5 (the first version). Ugh. EF4 is head and shoulders better than the original. Here's hoping EF 4.1 is another step forward. As a side note, there is an ignorant column published in a sister publication about how MS is stuck in a "time warp" because it took them 11 months to release SP1 for VS 2010 and Google releases a new version of Chrome every five minutes apparently. The fact that MS can and does release updates to specific technologies like EF, MVC, etc out of band with VS 2010 releases shows just how uninformed the author of that column is.

Wed, Mar 9, 2011

Finally. Just worked with Entity framework 1 the other day. Hated the designer UI

Add Your Comments Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above

.NET Insight

Sign up for our newsletter.

I agree to this site's Privacy Policy.