Entity Framework Integration

What Is Entity Framework?

Entity Framework (EF) is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. It eliminates the need for most of the data-access code that developers usually need to write.  It ships with .NET 4.0 and later (Visual Studio 2010 and later) and is Microsoft's preferred data access strategy for most applications.

Entity Framework sits between most application code and ADO.NET so it extends and can work with the traditional .NET data access methods.

Entity Framework 6 Support: A new provider for VistaDB 5 has been written that supports the updated EF 6 provider model.  It is available for .NET 4.0 and higher.

How does It Relate to VistaDB?

VistaDB is an ADO.NET provider and ships with the necessary extensions unique to Entity Framework to enable Entity Framework to work directly with it.  Entity Framework can automatically generate data access code compatible with VistaDB as well as many other databases.  Because Entity Framework was designed to be very independent of the underlying database technology it's possible to develop an application with Entity Framework and use multiple different database technologies behind the scenes, all transparent to the application.

There are a few key points to know about using EF with VistaDB:

  1. Only Database-First is Supported:  VistaDB doesn't currently support either Model First or Code First development approaches with Entity Framework.
  2. Provider Registration Required:  Microsoft ships the necessary provider for SQL Server to work with EF with the .NET framework but the VistaDB provider will have to be distributed with your application and registered before it can be used. 

Where Do I Get Started?

Most of the work you will do to enable data access with Entity Framework is common to all database technologies so your first step should be to visit the MSDN section on Entity Framework to get an understanding of the basics of using EF.  When you want to get started with your first project, follow the steps in Using VistaDB with Entity Framework - Getting Started.