Entity Framework Code-First(3):Setup Environment
Setup Development Environment for EF Code-First:
Let's setup the development environment for Code-First before starting on it.
Install the following tools to work with Entity Framework Code-First:
- .NET Framework 4.5
- Visual Studio 2012
- MS SQL Server 2008/2012 Express
Install EF via Nuget:
Here, we will install Entity Framework API (EntityFramework.dll) via NuGet in the VS 2012 console application. (You can install EF via NuGet the same way in any version of Visual Studio.)
First, create the console application. Right click on your project in the solution explorer and select Manage NuGet Packages..

This will open Manage NuGet Packages dialogue box. Now, select Online in the left bar and search for EntityFramework as shown below.

This will search for all the packages related to Entity Framework. Select EntityFramework and click on Install.

Click on the I Accept button in the License Acceptance dialogue box to start the installation.

After installation, make sure that the appropriate version of EntityFramework.dll is included in the project.

Now, we are ready to use Entity Framework Code-First in our sample console project. Let's start writing our first simple code-first example in the next section.
Entity Framework Code-First(3):Setup Environment的更多相关文章
- Entity Framework Tutorial Basics(4):Setup Entity Framework Environment
Setup Entity Framework Environment: Entity Framework 5.0 API was distributed in two places, in NuGet ...
- Entity Framework Code first(转载)
一.Entity Framework Code first(代码优先)使用过程 1.1Entity Framework 代码优先简介 不得不提Entity Framework Code First这个 ...
- Entity Framework Code First (三)Data Annotations
Entity Framework Code First 利用一种被称为约定(Conventions)优于配置(Configuration)的编程模式允许你使用自己的 domain classes 来表 ...
- Entity Framework Code First (二)Custom Conventions
---------------------------------------------------------------------------------------------------- ...
- Entity Framework Code First (一)Conventions
Entity Framework 简言之就是一个ORM(Object-Relational Mapper)框架. Code First 使得你能够通过C#的类来描述一个模型,模型如何被发现/检测就是通 ...
- Entity Framework Tutorial Basics(11):Code First
Code First development with Entity Framework: Entity Framework supports three different development ...
- Entity Framework Code First (七)空间数据类型 Spatial Data Types
声明:本文针对 EF5+, Visual Studio 2012+ 空间数据类型(Spatial Data Types)是在 EF5 中引入的,空间数据类型表现有两种: Geography (地理学上 ...
- Entity Framework Code First (四)Fluent API - 配置属性/类型
上篇博文说过当我们定义的类不能遵循约定(Conventions)的时候,Code First 提供了两种方式来配置你的类:DataAnnotations 和 Fluent API, 本文将关注 Flu ...
- Entity Framework Code First (八)迁移 Migrations
创建初始模型和数据库 在开始使用迁移(Migrations)之前,我们需要一个 Project 和一个 Code First Model, 对于本文将使用典型的 Blog 和 Post 模型 创建一个 ...
- Entity Framework Code First (六)存储过程
声明:本文只针对 EF6+ 默认情况下,Code First 对实体进行插入.更新.删除操作是直接在表上进行的,从 EF6 开始你可以选择使用存储过程(Stored Procedures) 简单实体映 ...
随机推荐
- Spark- Spark普通Shuffle操作的原理剖析
在spark中,什么情况下会发生shuffle? reduceByKey,groupByKey,sortByKey,countByKey,join,cogroup等操作. 默认的shuffle操作的原 ...
- httpRequest.CookieContainer= cookie 与 httpRequest.Headers.Add("Cookie", cookie)
这两天做了一个获取cookie并且携带此cookie去请求另外一个url地址,中间携带cookie用了两种方式:1. httpRequest.CookieContainer= cookie (此coo ...
- hdu 1864 最大报销额(01背包)
最大报销额 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi ...
- python代码docstring生成文档之sphinx
在使用python中,我们一般在模块,类,函数下使用docstring添加字符串说明性文档,使开发人员更好的可以看懂此代码是做什么用的.然而写了那么多的注释,我们想要一篇文档怎么办,第一种办法不可能将 ...
- 关于phonegap的cookie
angular搞了一半现在开始搞phonegap(确切的说应该叫cordova). 因为有很紧迫的需求,所以我也不能系统的学,只能遇到啥问题就解决啥.第一个问题就是cookie. 经过调研,cordo ...
- Eclipse_插件_01_tomcat插件的安装
1.Eclipse的tomcat插件下载地址: (1)https://sourceforge.net/projects/tomcatplugin/files/updatesite/plugins/ ( ...
- php如何判断电脑访问还是手机访问?
手机上网用户数量越来越大,如今各网站都推出了手机网站,电脑用户访问时直接访问电脑版网页,当用户通过手机访问网站时则跳自动跳转到手机版网页,下面给大家分享一段php中判断电脑访问还是手机访问的代码: & ...
- 关于python包,模块,.pyc文件和文件导入理解
参考文献 一.包 包是一个文件夹,用来存放模块和子包. 包里一般会有一个__init__.py的文件(也可以没有). 包里会有一个__pycache__文件夹,存放.py文件经解释器解释后的中间字节码 ...
- SQL的CASE表达式用法
case 表达式从SQL-92标准开始引入,因此是不依赖于具体的数据库技术,可提高SQL代码的可移植性. case表达式注意事项: 1. 统一各个分支返回数据类型,并保证各个when字句的排他性,因为 ...
- 如何在Android开发中测试应用在真机上实验
1.首先将手机设置为调试模式 方法:设置——应用程序——开发——USB调试,打上√即可 2.用数据线连接至电脑 3.然后打开eclipse 右击点击工程,选择 Run as,再选择Run ...