MySQL and the Entity FrameworkReggie Burnett Sun Microsystems

About MySQL 14 years of development Acquired by Sun in Feb 2008 12 million product installations 85,000 downloads a day Performance, reliability, scalability Easy to use, administer, maintain

Leadership, innovation, market acceptance


Industry-Leading Customers

Web / Web 2.0


On Demand, SaaS, Hosting


Enterprise 2.0

Powered by MySQL3

What will we cover today?A brief overview of the entity frameworkThis will not be an exhaustive review. Consider it 100 level.

A peek under the hood at how Connector/Net works with the entity framework A demonstration using MySQL and the entity framework A quick look at some of the work arounds we use to work with MySQL How you can reach me? [email protected]

What is the Entity Framework?Released in July as part of Visual Studio 2008 SP1

Entities You want to code against objects that make sense for your application but you want to work against any data source.5

What can an entity represent? almost anything! It

SQL Data Services (SDS)) Google BigTable


So why use the Entity Frameworkinstead of ADO.Net?Normal ORM arguments here Change tracking, use of conceptual objects Application portability

instead of LINQ to SQL?Entity Framework has a full provider model allowing future use of all types of data stores Entity Framework is much more flexible than L2S (inheritance and complex types)


So why use the Entity Frameworkinstead of Nhibernate (or .)?So the differentiator is not that the EF supports more flexible mapping than nHibernate or something like that, it's that the EF is not just an ORM--it's the first step in a much larger vision of an entity-aware data platform -- Danny Simmons (Entity Framework team)

Fits better into the long term data platform vision from Microsoft Many future Microsoft tools will be leveraging the entity framework including tools such as SQL Reporting Services Allows common tools to be written (i.e. EF model browser in Visual Studio)


Scotty, I need that mapping!

Conceptual (CSDL)

Mapping (MSL)

Storage (SSDL)9

The man behind the curtainEntity Framework converts query into queries against physical store

which are then converted into command trees


Connector/ Net

which are converted into SQL by Connector/Net


How the components stack upWe use a separate assembly for compatibility reasons

Your ApplicationEF ( Connector/net (


Deployment on a local box Web deployment steps will work locally as well Installer will place components where they need to be You must use the installer to get design time modeling

If not using the installer should be installed into GAC ..and registered in machine.config (installutil should be installed into the GAC .. but does not need to be installed using installutil.


Deployment to the web Same procedure as deploying to the web Create a reference from your project to and Modify your web.config so the provider can be found:

Free trial offer MySQL Enterprise.>

Take advantage of the Enterprise Unlimited Server offer.>

Try before you buy, then save.>

Save on a Sun server/storage bundle.>

Webinar replay (posted in three days)


Upcoming Webinars>For ISVs: What's New in MySQL Connector/NET 6.1

Tues 15 Sept, 10 am PT >For ISVs: Architecting Embedded Databases for High Performance Applications, Wed 23

Sept, 10 am PT

MySQL ISV / OEM Customers

Chance to Win A $150 Gift Certificate!>Just complete MySQL's 3 minute survey on your product's development cycle

Contact MySQL

Top Related