27

我必须在 C#.Net 4.0 中开发一个桌面 Windows 应用程序,它将在三个不同的数据库中运行,即。MS Access 2007 及更高版本、Oracle 11G 和 SQL Server 2008。现在我想在我的应用程序中使用实体框架。这是在我的应用程序中使用 EF 的最佳选择吗?如果是,那么如何使用 Access 数据库的实体框架?提前致谢。

4

3 回答 3

17

您可以使用 Microsoft Access 的实体框架提供程序将 EF 与 Microsoft Access 一起使用。您可以为 Access 找到 EF 提供程序

https://github.com/bubibubi/JetEntityFrameworkProvider

于 2015-01-05T15:57:22.743 回答
9

See this answer. Ask yourself why you need Access, could you use SQL Express instead? If you absolutely need Access then it would seem EF is not the right choice in this instance.

Putting Access to one side for the moment, it's perfectly possible to change data providers with EF (particularly code-first) as EF abstracts a lot of the database goo away from your code; depending on the database design it could be as simple as changing the connection string dynamically. The practical implications of this really do depend on your database design and the nature and complexity of the application you are building. See this question for example, here's another example.

于 2012-07-12T10:06:38.377 回答
6

在使用 MS Access 时,我们使用 Dapper 作为我们的 ORM 和存储库。这是梦幻般的。

于 2015-08-20T09:50:29.397 回答