postgresql Visual Studio 实体框架连接到 Postgres 数据库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11858586/
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
Visual Studio Entity Framework connect to Postgres database
提问by robertpas
I want to connect to a Postgres database using EntityFramework. Is that possible?
我想使用 EntityFramework 连接到 Postgres 数据库。那可能吗?
I select:
我选择:
Add>>New Item>>ADO.Net Entity Data model>>Generate from database>>New connection
添加>>新建项目>>ADO.Net实体数据模型>>从数据库生成>>新建连接
But I'm stuck there. I need to generate classes for the tables in the database.
但我被困在那里。我需要为数据库中的表生成类。
How can I do this?
我怎样才能做到这一点?
采纳答案by Eggi
The best solution to use PostgreSQL in combination with Entity Framework is the dotConnect provider from Devart.
将 PostgreSQL 与实体框架结合使用的最佳解决方案是来自 Devart 的 dotConnect 提供程序。
You can find the PostgreSQL provider here:
您可以在此处找到 PostgreSQL 提供程序:
回答by Craig Ringer
The following question:
以下问题:
is extremely similar to yours, and covers the same ground. You will see references to npgsql there, and to Devart.
与你的极为相似,并且涵盖相同的领域。您将在那里看到对 npgsql 和 Devart 的引用。