我们可以用MySql使用EF迁移 [英] Can we use EF migrations with MySql

查看:137
本文介绍了我们可以用MySql使用EF迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用EntityFramework 4.3测试版与MySql数据库进行迁移?我们可以使用MySql数据库进行迁移吗?是否可以使用增量数据库开发与EF代码首先没有我触摸数据库

解决方案

理论上是的。实际上,您首先需要从 System.Data.Entity.Migrations.Sql.MigrationSqlGenerator 获取(或创建自己)类,它将负责为MySQL生成SQL。 这里更多关于自定义(或重写)SQL



您还可以等到EF支持ADO.NET提供商的开发人员将此功能包含在其包中。例如 Devart已经开始了他们的迁移支持工作 for甲骨文,MySQL,PostgreSQL和SQLite。


Is there a way to use EntityFramework 4.3 beta with migrations with MySql database? Can we use migrations with MySql Database? Is it possible to use incremental database development with EF code first without me touching the database

解决方案

Theoretically yes. Practically you first need to get (or create yourselves) class derived from System.Data.Entity.Migrations.Sql.MigrationSqlGenerator which will be responsible for generating SQL for MySQL. Here is more about customizing (or rewriting) SQL generation.

You can also wait until developers of EF supporting ADO.NET providers include this feature to their packages. For example Devart already started work on their migrations support for thier Oracle, MySQL, PostgreSQL and SQLite.

这篇关于我们可以用MySql使用EF迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆