实体框架连接oracle数据库

我正在使用实体框架 6.1 版本和 oracle 11.我是实体框架的新手.谁能建议与oracle连接的先决条件是什么.web.config 中需要进行任何更改.在web.config中,默认是用sql连接的,如何改成使用Oracle而不是sql.

I am using Entity framework 6.1 version and oracle 11. I am new to entity framework. Can anyone please suggest what are the prerequisites for connecting with oracle. any changes are required in the web.config. In web.config,default it is connecting with sql,how can i change it to use Oracle instead of sql.

推荐答案

我有一个带有 EF 6 和 oracle 11g 的示例项目,只使用 nuget 包:

I have a sample project with EF 6 and oracle 11g which only uses nuget packages:

https://github.com/ovidiubuligan/EntityFramework_Oracle_sample

最重要的部分是 App.config 和 packages.config.

The most important parts are App.config and packages.config.

如果您查看 App.config,您会看到它将使用连接字符串:connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=... 而不是 tns 文件 http://www.orafaq.com/wiki/Tnsnames.ora .我觉得更舒服.

If you look in App.config you will see that it will use the connection string : connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=... instead of a tns file http://www.orafaq.com/wiki/Tnsnames.ora . I find it more confortable.

相关文章