Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is EntityFramework available for Windows 8 Store Apps?

Is EntityFramework available for Windows 8 Store Apps?

I'm using Visual Studio 2012 Express for Windows 8. I'm starting to wonder because I can't make it work.

I installed the Entity Framework package from NuGet I added System.Data.Entity and System.Data.Design to the project

But no matter what I do, DbContext isn't recognized...

Any ideas?

EDIT:

EntityFramework isn't available for Windows Store Apps. I don't understand Microsoft position on this, they suck.

The other solution is to use SQLite but it's not ORM. So what's the point?

like image 707
Antoine Gamond Avatar asked Mar 11 '13 09:03

Antoine Gamond


2 Answers

As far as I know, Windows 8 Store Apps target WinRT (Windows Runtime).

For that reason, because WinRT can be targeted using C# and there're a lot of classes from .NET Framework having a match in WinRT, most of available code base not using very specific libraries may work also on Windows 8 Store Apps.

There're a lot of things unavailable in WinRT. For example, Entity Framework is built on top of ADO.NET and this isn't available on WinRT.

Visual Studio is smart enough to hide such classes and components that aren't available on WinRT and this is why Entity Framework related classes can't be used in your Windows 8 Store App project.

In order to use Entity Framework, you'll need to create a RESTful Web API (for example using ASP.NET Web API) and access the data layer asynchronously over the wire.

Otherwise, you'll need to use a local database storage like SQLite or XML.

like image 132
Matías Fidemraizer Avatar answered Nov 15 '22 16:11

Matías Fidemraizer


Entity Framework is not available for Windows 8 store apps. This is due to the fact that windows store apps run in a sandbox and will not be able to use normal database. You can use SQLite for this or have XML / JSon as source which you can deploy in IsolatedStorage of the app on first start of the app.

like image 24
Jordy van Eijk Avatar answered Nov 15 '22 16:11

Jordy van Eijk