Skip to content

EF7 Support #249

Closed
Closed

Description

@borgdylan

Will it be possible to support EF7 (part of ASP.NET vNext)?

Activity

  1. franciscojunior commented on Jun 6, 2014

    @franciscojunior
    Member

    Hi, @borgdylan !

    Sure. We will work on that too. It may take some time though.

  2. borgdylan commented on Jun 6, 2014

    @borgdylan
    ContributorAuthor

    I will test the code once it is available and provide feedback

  3. roji commented on Jul 21, 2014

    @roji
    Member

    It looks like we'll need to wait for EF7 to get more mature - it's not yet near release...

  4. added a commit that references this issue on Aug 4, 2014
  5. borgdylan commented on Sep 23, 2014

    @borgdylan
    ContributorAuthor

    FYI: EF7 will soon start its beta iterations

  6. Emill commented on Sep 23, 2014

    @Emill
    Contributor

    Where can we read about this?

  7. borgdylan commented on Sep 23, 2014

    @borgdylan
    ContributorAuthor

    github.com/aspnet/EntityFramework -> all the code is there and runs ok cross-platform. The only thing missing in EF7 to make the world OK again is Npgsql support. They already have SQL Server, SQLite, Azure Table Storage and Redis providers most of which are open source in the repo.

  8. roji commented on Sep 24, 2014

    @roji
    Member

    @Emill, what do you say? Want to work on this for 3.0? :)

  9. Emill commented on Sep 25, 2014

    @Emill
    Contributor

    I can have a look at it, but I think it might be better to wait a bit until it gets more mature...

    As you try out EF7 please bear in mind that this is a very early stage in the development of the new EF codebase and there are many features that are partially implemented or not yet available.

    @borgdylan have you tested EF7 and can say something about its usability if it's ready to use? Would anyone today use EF7 instead of EF6?

    I took a look at https://github.com/aspnet/MusicStore/blob/master/src/MusicStore/Controllers/HomeController.cs:

           // TODO [EF] We don't query related data as yet, so the OrderByDescending isn't doing anything
            return db.Albums
                .OrderByDescending(a => a.OrderDetails.Count())
                .Take(count)
                .ToList();
        }
    

    It looks like you can't do queries that execute correctly yet.

  10. borgdylan commented on Sep 25, 2014

    @borgdylan
    ContributorAuthor

    I have tried it with sqlite for simple databases. I have opened this issue to let the Ngsql team know that EF7 is in the works, so it would be supported on day 1 when it is released. The more lightweight form factor of EF7 helps when you want many web services on the same machine.

    Also notice that the code you say in the sample is probably old. EF7 is being updated with new/re-introduced features every day.

  11. borgdylan commented on Oct 10, 2014

    @borgdylan
    ContributorAuthor

    People who do protoyping would use EF7 for its cross-platform sqlite support and also for its support of noSQlL dbs. Currently as it stands if you are on EF7 you cannot switch to Npgsql when the project becomes more serious.

  12. borgdylan commented on Dec 7, 2014

    @borgdylan
    ContributorAuthor
  13. franciscojunior commented on Dec 7, 2014

    @franciscojunior
    Member

    Hi, @borgdylan !

    Thanks for the heads up about that. I also saw that declaration and I'm very excited about those news. This is very rewarding and shows the importance of Postgresql for .Net development.

    We are committed to give support to EF7.

  14. 108 remaining items

  15. Codenator81 commented on Sep 7, 2015

    @Codenator81

    Got error in VS 2015 but when run from DNX (beta8) no problem.
    Error was:
    'EntityFrameworkServicesBuilder' does not contain a definition for 'AddNpgsql' and no extension method 'AddNpgsql' accepting a first argument of type 'EntityFrameworkServicesBuilder' could be found (are you missing a using directive or an assembly reference?) MvcMovie.DNX Core 5.0 C:\Users\Alex\Desktop\c#\Code\MvcMovie\src\MvcMovie\Startup.cs 60

  16. roji commented on Sep 7, 2015

    @roji
    Member

    Please open new issues rather than post them here. I think you're trying to use .NET Core (CoreCLR) which isn't yet supported, try switching to .NET 4.5/4.6

  17. BeranekCZ commented on Sep 24, 2015

    @BeranekCZ

    Hi, I am trying use npgsql EF7 provider (ASP.NET 5 MVC 6 app). But there is not any turorial on your site. I tried write this to startup.cs

    services.AddEntityFramework()
                    .AddSqlServer()
                    .AddDbContext<ApplicationDbContext>(options =>
                        options.UseNpgsql(@"Server=127.0.0.1;port=5432;Database=db;User Id=user;Password=pswd;"));
    

    I got this error: InvalidOperationException: No database providers are configured. Configure a database provider by overriding OnConfiguring in your DbContext class or in the AddDbContext method when setting up services.

  18. smbecker commented on Sep 24, 2015

    @smbecker

    Try using AddNpgsql rather than AddSqlServer

  19. BeranekCZ commented on Sep 24, 2015

    @BeranekCZ

    Yes. I saw It after I hit comment button. Sorry.

  20. roji commented on Sep 24, 2015

    @roji
    Member

    Note, have added a bit more info on the Npgsql EF7 page, hopefully this should get people started quicker.

  21. marinalexandru commented on Sep 24, 2015

    @marinalexandru

    Hello

    Regarding Codenator81 problem i have a related issue.
    I try to build on .net core.
    As far as i understand there has been registered a commit that states CoreCLR and project.json work (I know this has not been included in a release) but my understanding is that every accepted commit goes to the unstable builds (via the npgsql unstable feed https://www.myget.org/F/npgsql-unstable/api/v3/index.json).

    So my project now references both "EntityFramework7.Npgsql": "3.1.0-unstable0249" and "Npgsql": "3.1.0-unstable0249" packages. My understanding is that the core support is active on this unstable builds. So i expected the:

    services.AddEntityFramework()
    .AddNpgsql()
    .AddDbContext(options =>
    options.UseNpgsql(Configuration["Data:DefaultConnection:ConnectionString"]));

    to work but i still get the error:
    "EntityFrameworkServicesBuilder does not contain a definition for 'AddNpgsql' etc .. " on DNX Core 5.0.

    Is there something im doing wrong or is there another solution so that i could reference a package that should have the core support in it?

    Thx in advance

    P.S.: also is there a guide how i could build locally the github repo maybe i could reference it by a dll .. (just a thought)

  22. roji commented on Sep 24, 2015

    @roji
    Member

    @marinalexandru, we're not quite there yet - the nuget packages in the unstable feed are produced by our build server (TeamCity), which doesn't yet produce .NET Core builds. I'll be working on this in the coming days.

    If you're in a hurry, you can clone the npgsql repo and build yourself. One build step that's missing from the project.json build is async code generation, which you can do by running msbuild Npgsql.csproj /t:RewriteAsync before building.

    Otherwise I think there should be .NET Core assemblies in the unstable nugets within a week or so...

  23. Codenator81 commented on Sep 25, 2015

    @Codenator81

    @marinalexandru just wrap your code in

    #if DNX451
            services.AddEntityFramework()
    .AddNpgsql()
    .AddDbContext(options =>
    options.UseNpgsql(Configuration["Data:DefaultConnection:ConnectionString"]));
    #endif

    for now it is solution

  24. marinalexandru commented on Sep 25, 2015

    @marinalexandru

    @Codenator81
    Thx for your sugestion but i actualy need it to work on .net core and this wont really fix the problem will just make the project build (basicaly im building .net core on linux thats why I need /net core)

    @roji
    With your sugestion i built the npgsql project with AsyncRewriter project as target and was able to get the npgsql dll succesfully (thx for this). Then i used the npgsql dll as a dependency for the Entityframework7.Npgsql project so i could get the EF7.npgsql dll also but here it fails with a bunch of errors(most with missing references) - i tried with asyncrewriter also. To build the EF7.Npgsql project do i need to do somethin special also? (i assume that i need to reference both dlls to my project, especialy the EF7.Npgsql one because there is where my code fails)

    P.S.Is there any uploaded resource with the dlls? (though im quite sure there are not).
    Anyway if I'm unable to fix this now waiting for the unstable feeds is not such a bad perspective also but if there is a quick fix I'm gladly open to try it out and post the results here .

    Thx

  25. roji commented on Sep 25, 2015

    @roji
    Member

    @marinalexandru no DLLs available yet, that's what the unstable feeds will contain soon.

    You don't need to fiddle with any dependencies or anything for compiling EntityFramework7.Npgsql, you should be able to simply clone the repo, do the async rewriting step, do dnu restore in EntityFramework7.Npgsql and then dnu build. If this doesn't work for you give it a few days and I'll get the nugets on the unstable feed.

  26. marinalexandru commented on Oct 21, 2015

    @marinalexandru

    With this version of Npgsql I was able to build a project with EF7-beta8 and core .net support. Then I deployed it to a custom linux machine in a docker volume-container with web tools 2015 beta 8 and with tools for docker and everything went fine.

  27. roji commented on Oct 22, 2015

    @roji
    Member

    @marinalexandru great to hear!

  28. roji commented on Oct 22, 2015

    @roji
    Member

    Am closing this issue, specific EF7 features can be tracked in their own issues (see the EF7 tag)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions