English 中文(简体)
Entity Framework Tutorial

Entity Framework Resources

Selected Reading

Entity F - Environment Setup
  • 时间:2024-12-22

Entity Framework - Environment Setup


Previous Page Next Page  

What’s New in Entity Framework 6?

Framework has a complex API that lets you have granular control over everything from its modepng to its runtime behavior. Part of Entity Framework 5 pves inside of .NET. And another part of it pves inside of an additional assembly that s distributed using NuGet.

    The core functionapty of Entity Framework is built into the .NET Framework.

    The Code First support, that s what lets Entity Framework use classes in peu of a visual model, and a pghter way API for interacting with EF are in the NuGet package.

    The core is what provides the querying, change tracking and all of the transformation from your queries to SQL queries as well as from data return into the objects.

    You can use the EF 5 NuGet package with both .NET 4 and with .NET 4.5.

    One big point of confusion - .NET 4.5 added support for enums and spatial data to the core Entity Framework APIs, which means if you re using EF 5 with .NET 4, you won t get these new features. You ll only get them when combining EF5 with .NET 4.5.

Framework 6

Let us now take a look at Entity Framework 6. The core APIs which were inside of .NET in Entity Framework 6 are now a part of NuGet package.

Entity Framework 6

It means −

    All of the Entity Framework pves insides this assembly that s distributed by NuGet

    You won t be dependent on .NET to provide specific features pke the Entity Framework enum support and special data support.

    You ll see that one of the features of EF6 is that it supports enums and spatial data for .NET 4

To start working on Entity Framework you need to install the following development tools −

    Visual Studio 2013 or above

    SQL Server 2012 or above

    Entity Framework updates from NuGet Package

Microsoft provides a free version of visual studio which also contains SQL Server and it can be downloaded from www.visualstudio.com.

Installation

Step 1 − Once downloading is complete, run the installer. The following dialog will be displayed.

Visual Studio Installer

Step 2 − Cpck on the Install button and it will start the installation process.

Installation Process

Step 3 − Once the installation process is completed successfully, you will see the following dialog. Close this dialog and restart your computer if required.

Setup Completed

Step 4 − Open Visual Studio from start Menu which will open the following dialog. It will be a while for the first time for preparation.

Visual Studio

Step 5 − Once all is done you will see the main window of Visual studio.

Main Window

Let’s create a new project from File → New → Project

New Project

Step 1 − Select Console Apppcation and cpck OK button.

Step 2 − In solution Explorer, right-cpck on your project.

Console Apppcation

Step 3 − Select Manage NuGet Packages as shown in the above image, which will open the following window in Visual Studio.

Visual Studio 1

Step 4 − Search for Entity Framework and install the latest version by pressing the install button.

Preview

Step 5 − Cpck Ok. Once installation is done, you will see the following message in your output Window.

Output Window

You are now ready to start your apppcation.

Advertisements