19 July 2014

Entity Framework Tips

Namespace of Entity framework:
Entity Framework 5.0:
System.Data.Entity
System.Data.Entity.Infrastructure
System.Data.Entity.Migrations
System.Data.Entity.Migrations.Builders
System.Data.Entity.Migrations.Design
System.Data.Entity.Migrations.History
System.Data.Entity.Migrations.Infrastructure
System.Data.Entity.Migrations.Model
System.Data.Entity.Migrations.Sql
System.Data.Entity.Migrations.Utilities
System.Data.Entity.ModelConfiguration
System.Data.Entity.ModelConfiguration.Configuration
System.Data.Entity.ModelConfiguration.Conventions
System.Data.Entity.Validation
******************************************************
Entity Framework 6.0:
Microsoft.Data.Entity.Design
Microsoft.Data.Entity.Design.CodeGeneration
Microsoft.Data.Entity.Design.DatabaseGeneration
Microsoft.Data.Entity.Design.DatabaseGeneration.Activities
Microsoft.Data.Entity.Design.DatabaseGeneration.OutputGenerators
Microsoft.Data.Entity.Design.Extensibility
Microsoft.Data.Entity.Design.Templates
Microsoft.Data.Entity.Design.UI.Views.Explorer
Microsoft.Data.Entity.Design.VisualStudio.ModelWizard
Microsoft.Data.Entity.Design.VisualStudio.SingleFileGenerator
Microsoft.Data.Entity.Design.VisualStudio.TextTemplating
System.ComponentModel.DataAnnotations.Schema
System.Data.Entity
System.Data.Entity.Core
System.Data.Entity.Core.Common
System.Data.Entity.Core.Common.CommandTrees
System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder
System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder.Spatial
System.Data.Entity.Core.Common.EntitySql
System.Data.Entity.Core.EntityClient
System.Data.Entity.Core.Mapping
System.Data.Entity.Core.Metadata.Edm
System.Data.Entity.Core.Objects
System.Data.Entity.Core.Objects.DataClasses
System.Data.Entity.Infrastructure
System.Data.Entity.Infrastructure.Annotations
System.Data.Entity.Infrastructure.DependencyResolution
System.Data.Entity.Infrastructure.MappingViews
System.Data.Entity.Infrastructure.Pluralization
System.Data.Entity.Migrations
System.Data.Entity.Migrations.Builders
System.Data.Entity.Migrations.Design
System.Data.Entity.Migrations.History
System.Data.Entity.Migrations.Infrastructure
System.Data.Entity.Migrations.Model
System.Data.Entity.Migrations.Sql
System.Data.Entity.Migrations.Utilities
System.Data.Entity.ModelConfiguration
System.Data.Entity.ModelConfiguration.Configuration
System.Data.Entity.ModelConfiguration.Conventions
System.Data.Entity.Spatial
System.Data.Entity.SqlServer
System.Data.Entity.SqlServerCompact
System.Data.Entity.Validation
XamlGeneratedNamespace
******************************************************
Entity Framework 5.0 Features:

  • This release can be used in Visual Studio 2010 and Visual Studio 2012 to write applications that target .NET 4.0 and .NET 4.5. When targeting .NET 4.5 this release introduces some new features including enum support, table-valued functions, spatial data types and various performance improvements.
  • If you create a new model using the Entity Framework Designer in Visual Studio 2012, the EF5 NuGet package will be installed to your project and the generated code will make use of EF5. New ASP.NET projects created in Visual Studio 2012 (including MVC projects) also have the EF5 NuGet package installed by default.
  • The Entity Framework Designer in Visual Studio 2012 also introduces support for multiple-diagrams per model, coloring of shapes on the design surface and batch import of stored procedures.

*****************************************************************
Entity Framework 6.0 Features:

  • Async Query and Save adds support for the task-based asynchronous patterns that were introduced in .NET 4.5.
  • 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.
  • Testability improvements make it easier to create test doubles for DbContext and DbSet when using a mocking framework or writing your own test doubles.
  • 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 can not guarantee the state of the connection).
  • Improved Transaction Support provides support for a transaction external to the framework as well as improved ways of creating a transaction within the Framework.
  • Enums, Spatial and Better Performance on .NET 4.0 - By moving the core components that used to be in the .NET Framework into the EF NuGet package we are now able to offer enum support, spatial data types and the performance improvements from EF5 on .NET 4.0.
  • Improved performance of Enumerable.Contains in LINQ queries.
  • Improved warm up time (view generation), especially for large models. 
  • Pluggable Pluralization & Singularization Service.
  • Custom implementations of Equals or GetHashCode on entity classes are now supported.
  • DbSet.AddRange/RemoveRange provides an optimized way to add or remove multiple entities from a set.
  • DbChangeTracker.HasChanges provides an easy and efficient way to see if there are any pending changes to be saved to the database.
  • SqlCeFunctions provides a SQL Compact equivalent to the SqlFunctions.

*****************************************************************