7

exists currently any way, how to communicate with PostgreSql database, when I want to use ASP.NET vNext? I'm looking for solution, which will work mainly on linux.

EF7 supports only MS SQL a SqlLite now and Npgsql isn't ported for ASP.NET vNext.

Thanks

2
  • There was Redis and SqlLite implementation for beta1, if you want I maintain the Redis implementation. It will be soon ready for beta3. check out my gitub github.com/aguacongas/EntityFramework. Or you can implement your own PostgreSql implementation... Commented Mar 7, 2015 at 17:09
  • My EntityFramework.Redis is available on myget for beta3 add myget.org/F/chatle/api/v2 in your NuGet feeds Commented Mar 15, 2015 at 19:06

3 Answers 3

3

Instead of EF7 you can use NHibernate together with Fluent NHibernate. Npgsql is also working well on ASP.NET 5 (vNext) on Linux. Here is a complete example of ASP.NET vNext application with NHibernate + PostgreSQL working on ubuntu server.

Sign up to request clarification or add additional context in comments.

Comments

2

I'm still testing this out (on dnx-coreclr-win-x64.1.0.0-rc2-16177 at the moment), but they have made a lot of progress since @bricelam answered. They now have some EF7 docs including some on CoreCLR support

Here's part of my project.json:

"dependencies": {
  "EntityFramework.Commands": "7.0.0-rc2-*",
  "EntityFramework.Core": "7.0.0-rc2-*",
  "EntityFramework.Relational": "7.0.0-rc2-*",
  "EntityFramework7.Npgsql": "3.1.0-rc1-2",
},
"frameworks": {
  "dnxcore50": {}
}

You will probably need to add https://www.myget.org/F/npgsql-unstable/api/v3/index.json to your NuGet feeds in order to pull that package. EDIT: I now specify an exact version of EntityFramework7.Npgsql": "3.1.0-rc1-2" and use only this feed in my NuGet.config: https://www.myget.org/F/aspnetrelease/api/v3/index.json

EDIT: This is all now available in https://api.nuget.org/v3/index.json

In Startup.cs:

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddEntityFramework()
            .AddNpgsql()
                .AddDbContext<YourDbContext>(options => options.UseNpgsql("your connectionString"))
            ;
    }

2 Comments

I dont think you need the MyGet source
Thanks @ErikEJ I tested this on dnx-coreclr-win-x64.1.0.0-rc2-16302 and edited my answer.
0

The Npgsql community is working on an EF7 provider. I'm sure the code is available somewhere if you want to start using it.

1 Comment

Yes, thanks, but support for .NET Core is plan as a feature - github.com/npgsql/npgsql/issues/471

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.