Unable to create database in PostreSQL using Npgsql and Entity Framework code first

后端 未结 3 1119
温柔的废话
温柔的废话 2021-01-02 20:25

I am attempting to set up my application to use Entity Framework with PostgreSQL, but I have run up against a problem. I have added Npqsql via nuget, and added

3条回答
  •  一生所求
    2021-01-02 21:09

    Unfortunately, Npgsql does not have (as of now) automatic schema creation code-first.

    You can create your database first, and then connect to it.

    Update (2016): Npgsql 3 now implements database creation code-first. Make sure you configure the correct connection factory to use NpgsqlConnections, either via code or via the XML settings, and use an appropriate Connection String.

提交回复
热议问题