1、修改 Migrations/Configuration.cs 文件
 namespace DataModel.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq; internal sealed class Configuration : DbMigrationsConfiguration<DataModel.SpaceDataContext>
{
public Configuration()
{
12 AutomaticMigrationsEnabled = true;
13
14 AutomaticMigrationDataLossAllowed = true;
15
16 SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator()); // This will add our MySQLClient as SQL Generator
} protected override void Seed(DataModel.SpaceDataContext context)
{
// This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method
// to avoid creating duplicate seed data. E.g.
//
// context.People.AddOrUpdate(
// p => p.FullName,
// new Person { FullName = "Andrew Peters" },
// new Person { FullName = "Brice Lambson" },
// new Person { FullName = "Rowan Miller" }
// );
//
}
}
}
2、修改 App.config 文件 entityFramework 节点
   <entityFramework>
<defaultConnectionFactory type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" />
<contexts>
<context type="DataModel.SpaceDataContext,DataModel">
<databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[DataModel.SpaceDataContext,DataModel], [DataModel.Migrations.Configuration,DataModel]], EntityFramework" />
</context>
</contexts>
</entityFramework>
3、完事!! 注意红色高亮处哦

  

Mysql 6.7.7 + EntityFramework 5.0 Code First 不能 Update-Database 问题的解决的更多相关文章

  1. EntityFramework 6.0< Code First > 连接 Mysql数据库(转)

    http://blog.csdn.net/kmguo/article/details/19650299 网上有很多关于用EntityFrame来连接Mysql数据库的教程,可是很多并不靠谱,转载的太多 ...

  2. EntityFramework 6.0< Code First > 连接 Mysql数据库

    网上有很多关于用EntityFrame来连接Mysql数据库的教程,可是很多并不靠谱,转载的太多了.找了很久,总算是配置好了,现在分享一下. 一,安装:     1.开发环境: VS2013与EF6 ...

  3. 转载:EntityFramework 6.0< Code First > 连接 Mysql数据库

    转载自:http://blog.csdn.net/kmguo/article/details/19650299 网上有很多关于用EntityFrame来连接Mysql数据库的教程,可是很多并不靠谱,转 ...

  4. MYSQL 1093 之You can't specify target table for update in FROM clause解决办法

    You can't specify target table for update in FROM clause含义:不能在同一表中查询的数据作为同一表的更新数据. 出现以上错误,是因为想将表自身的字 ...

  5. EntityFramework Reverse POCO Code First 生成器

    功能强大的(免费)实体框架工具 Julie Lerman 实体框架是开源的,因此开发社区可以在 entityframework.codeplex.com 上共享代码. 但是不要将自己局限在那里寻找工具 ...

  6. MySQL中文全文索引插件 mysqlcft 1.0.0 安装使用文档[原创]

    [文章+程序 作者:张宴 本文版本:v1.0 最后修改:2008.07.01 转载请注明原文链接:http://blog.zyan.cc/post/356/] MySQL在高并发连接.数据库记录数较多 ...

  7. EntityFramework 5.0 CodeFirst 教程03-数据结构的定义/列的属性

    ---------------------目录-------------------------- EntityFramework 5.0 CodeFirst 教程03-数据结构的定义/列的属性 (2 ...

  8. EntityFramework 5.0 CodeFirst 教程02-删除和修改/架构改变异常的处理

    -----------------------------------------------------目录--------------------------------------------- ...

  9. EntityFramework 5.0 CodeFirst 教程01-搭建环境和快速上手

    ----------------------------目录------------------------------ EntityFramework 5.0 CodeFirst 教程03-数据结构 ...

随机推荐

  1. 利用sql命令把结果集输出到文件

    利用sql命令把结果集输出到文件 红色部分的三条命令完成把结果集输出到文件!! [root@test root]# psql -hlocalhost -Utest testWelcome to psq ...

  2. 原已经安装好的nginx,现在需要添加一个未被编译安装的模块--echo-nginx-module-0.56

    为了测试一个NGINX变量,将NGINX加了一个编译模板echo-nginx-module-0.56. 参照如下文件 1,先看以前NGINX有哪些东东. sbin/nginx -Vnginx vers ...

  3. logstash 中的贪婪匹配

    logstash 中的贪婪匹配: 10.252.142.174 - - [06/Sep/2016:08:41:36 +0800] "GET /api/validate/code/send?m ...

  4. Intel处理器 天梯图

    http://www.mydrivers.com/zhuanti/tianti/cpu/ 更新日期: 2016年6月 纠      错: wenq#mydrivers.com   Core 2及之前 ...

  5. linux网址

    1. 上海爱墨电子科技有限公司 http://www.shaimo.cn/showproduct.asp?piccat_id=196&pic_id=780 2. http://lxr.free ...

  6. voijs1883 月光的魔法

    背景 影几欺哄了众生了天以外——月儿何曾圆缺 描述 有些东西就如同月光的魔法一般. Luke是爱着vijos的.他想为自己心爱的东西画些什么. 就画N个圆吧.把它们的圆心都固定在x轴上. 圆与圆.为了 ...

  7. Linux Java的环境变量搭建

    JAVA JDK:http://www.oracle.com/technetwork/java/javase/downloads/index.html 下载完后,解压完并将其中的jdk文件夹移动到/u ...

  8. Android 之 ExpandableListView 的使用

    喜欢显示好友QQ那样的列表,可以展开,可以收起,在android中,以往用的比较多的是listview,虽然可以实现列表的展示,但在某些情况下,我们还是希望用到可以分组并实现收缩的列表,那就要用到an ...

  9. WPF可视化控件打印

    Introduction While coding an application that displays a detailed report in a ScrollViewer, it was d ...

  10. New Year Transportation(水)

    New Year Transportation Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & ...