Entity Framework 6: New Features
In
this blog post you will see the list of cool things available with Entity
Framework 6. Entity Framework is Microsoft's recommended data access technology
for new applications. EF team recently announced the release of EF6 and it is
now available for download on NuGet. EF6 comes with number of features and performance
improvements, I have listed some of them below and I will cover most of the
cool things of EF6 in coming blog posts.
Features for models
created with Code First and EF Designer
Async
Query and Save
adds support for the task-based asynchronous patterns that were introduced in
.NET 4.5. With .NET 4.5 Microsoft introduced async and await keywords but in EF
5 Microsoft didn't have time to add support for async query and save but now
with EF6 it is supported.
Connection
Resiliency
enables automatic recovery from transient connection failures.
Code-Based
Configuration
gives you the option of performing configuration - that was traditionally
performed in a config file - in code.
Dependency
Resolution
introduces support for the Service Locator pattern and we've factored out some
pieces of functionality that can be replaced with custom implementations.
Interception/SQL
logging
provides low-level building blocks for interception of EF operations with simple
SQL logging built on top.
DbContext
can now be created with a DbConnection that is already opened which enables
scenarios where it would be helpful if the connection could be open when
creating the context (such as sharing a connection between components where you
cannot guarantee the state of the connection).
And
much more.
Features for code
first only
Custom
Code First Conventions allow write your own conventions to help avoid repetitive
configuration. We provide a simple API for lightweight conventions as well as
some more complex building blocks to allow you to author more complicated
conventions.
Code
First Mapping to Insert/Update/Delete Stored Procedures is now supported.
Idempotent
migrations scripts allow you to generate a SQL script that can upgrade a
database at any version up to the latest version.
Configurable
Migrations History Table allows you to customize the definition of the
migrations history table. This is particularly useful for database providers
that require the appropriate data types etc. to be specified for the Migrations
History table to work correctly. We’ve created a feature specification for this
feature.
Multiple
Contexts per Database
removes the previous limitation of one Code First model per database when using
Migrations or when Code First automatically created the database for you. We’ve
created a feature specification for this feature.
And
much more.
In
my upcoming blog posts, I will be talking about most of the features one by
one.
Hope
this helps.
really nice feature list, i am waiting for your feature by feature explanations.
ReplyDelete