You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
// 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.
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.
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.
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.
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
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
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.
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:
@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...
@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 .
@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.
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.
Activity
franciscojunior commentedon Jun 6, 2014
Hi, @borgdylan !
Sure. We will work on that too. It may take some time though.
borgdylan commentedon Jun 6, 2014
I will test the code once it is available and provide feedback
roji commentedon Jul 21, 2014
It looks like we'll need to wait for EF7 to get more mature - it's not yet near release...
Bugs #249 and #296 Unit Test Improvements
borgdylan commentedon Sep 23, 2014
FYI: EF7 will soon start its beta iterations
Emill commentedon Sep 23, 2014
Where can we read about this?
borgdylan commentedon Sep 23, 2014
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.
roji commentedon Sep 24, 2014
@Emill, what do you say? Want to work on this for 3.0? :)
Emill commentedon Sep 25, 2014
I can have a look at it, but I think it might be better to wait a bit until it gets more mature...
@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:
It looks like you can't do queries that execute correctly yet.
borgdylan commentedon Sep 25, 2014
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.
borgdylan commentedon Oct 10, 2014
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.
borgdylan commentedon Dec 7, 2014
please note that MSFT is looking to have Postgres support for EF7 as part of the current focus of development as per http://blogs.msdn.com/b/adonet/archive/2014/12/02/ef7-priorities-focus-and-initial-release.aspx.
franciscojunior commentedon Dec 7, 2014
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.
108 remaining items
Codenator81 commentedon Sep 7, 2015
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
roji commentedon Sep 7, 2015
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
BeranekCZ commentedon Sep 24, 2015
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
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.
smbecker commentedon Sep 24, 2015
Try using AddNpgsql rather than AddSqlServer
BeranekCZ commentedon Sep 24, 2015
Yes. I saw It after I hit comment button. Sorry.
roji commentedon Sep 24, 2015
Note, have added a bit more info on the Npgsql EF7 page, hopefully this should get people started quicker.
marinalexandru commentedon Sep 24, 2015
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)
roji commentedon Sep 24, 2015
@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:RewriteAsyncbefore building.Otherwise I think there should be .NET Core assemblies in the unstable nugets within a week or so...
Codenator81 commentedon Sep 25, 2015
@marinalexandru just wrap your code in
for now it is solution
marinalexandru commentedon Sep 25, 2015
@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
roji commentedon Sep 25, 2015
@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 restorein EntityFramework7.Npgsql and thendnu build. If this doesn't work for you give it a few days and I'll get the nugets on the unstable feed.marinalexandru commentedon Oct 21, 2015
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.
roji commentedon Oct 22, 2015
@marinalexandru great to hear!
roji commentedon Oct 22, 2015
Am closing this issue, specific EF7 features can be tracked in their own issues (see the EF7 tag)