ASP.NET MVC + Oracle:示例和操作方法

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1540130/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 19:10:34  来源:igfitidea点击:

ASP.NET MVC + Oracle: samples and how-to

asp.net-mvcoracle

提问by

While reading NerdDinner, and browsing other examples on the internet regarding ASP.NET MVC with LINQ To SQL.

在阅读NerdDinner以及在 Internet 上浏览有关 ASP.NET MVC 和 LINQ To SQL 的其他示例时。

In my ASP.NET MVC project I have to connect to an Oracle database. The main goal of the application is to display, edit, and update data. I am uncertain if ASP.NET MVC can work with an Oracle database.

在我的 ASP.NET MVC 项目中,我必须连接到 Oracle 数据库。该应用程序的主要目标是显示、编辑和更新数据。我不确定 ASP.NET MVC 是否可以与 Oracle 数据库一起使用。

  • Has anyone ever done an ASP.NET MVC project with Oracle as the database?
  • Are there any articles with sample code that you'd recommend?
  • What are some easy ORMs or data access strategies that you'd recommend an ASP.NET (webforms or MVC) project use to communicate to an Oracle database?
  • 有没有人做过使用 Oracle 作为数据库的 ASP.NET MVC 项目?
  • 是否有您推荐的带有示例代码的文章?
  • 您推荐 ASP.NET(webforms 或 MVC)项目使用哪些简单的 ORM 或数据访问策略与 Oracle 数据库进行通信?

回答by Sly

You can use Nhibernateto get access to your DB.

您可以使用Nhibernate来访问您的数据库。

回答by Cam Soper

ASP.NET MVC can certainly support Oracle or any other data source behind the scenes.

ASP.NET MVC 当然可以在幕后支持 Oracle 或任何其他数据源。

MVC is not tied to Linq to SQL in any way. It's just one convenient way (among many) to get data from a datasource into your models.

MVC 不以任何方式绑定到 Linq to SQL。这只是将数据从数据源获取到模型中的一种便捷方式(其中之一)。

As Sly pointed out, NHibernate is one ORM framework that will work for you.

正如 Sly 指出的那样,NHibernate 是一种适合您的 ORM 框架。