不同数据库上的实体框架 [英] Entity Framework on different database

查看:100
本文介绍了不同数据库上的实体框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用实体框架的项目。
我们使用实体框架映射mssql数据库。现在,我们想将mssql db更改为oracle db。但是我不想在实体框架中更改数据库模型。两个数据库是相同的表列,等等。
唯一的不同是它们的技术(mssql和oracle)以及一些列数据类型。在mssql中,我们在Oracle中使用bigint而不是number。

I have a project which uses entity framework. We map a mssql db with entity framework. Now we want to change mssql db to oracle db. But I don't want to change my model of db in entity framework. Two dbs are same tables columns etc. only difference is their technologies(mssql and oracle) and some of the column data types.In mssql we use bigint instead of number in oracle. Is it possible to use same model with difference dbs which have same tables on Entity framework?

推荐答案

带有EF的提供程序模型允许支持适用于各种数据库。我相信这包括oracle,但是我从来没有亲自使用过。

The provider model with EF allows support for a variety of databases. I believe this includes oracle however I haven't ever used it personally.

我可以告诉您,在数据库提供者之间切换时,通常仅需更改连接字符串。我认为您唯一必须更改数据库中的所有内容的唯一一次是,如果提供程序不支持您正在使用的特定操作。

I can tell you that when switching between database providers the connection string is normally the only change required. The only time i think you would have to change anything at all in your database is if the provider didn't support a specific operation you are using.

这篇关于不同数据库上的实体框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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