Is EntityFramework available for Windows 8 Store Apps?

前端 未结 4 1580
深忆病人
深忆病人 2021-02-13 13:13

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.

相关标签:
4条回答
  • 2021-02-13 13:19

    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.

    0 讨论(0)
  • No it's not available. You may use SQLite, this HowTo was very helpful for me. Works great!

    0 讨论(0)
  • 2021-02-13 13:27

    For the record: The answer is not and the turnaround is to create a web service or use a cloud service. SqlLite is fine for store local (single user) information but nothing more.

    About this matter, not all, but most connections to the database are done via a socket connection. So its possible to connect to some database and still keeping the application in a sandbox. However, the intentions of MS is clear : cloud or bust. So MS is saying that its best to connect to a web service (another a socket connection) that its inefficient (and risky) rather to use a direct connection.

    Windows Store Apps is simply inferior.

    And for adding insult over injury, MS wants to cut some earning from our software.

    I really tried to like WinRT (now UWP) but its impossible. And during this 3 years, things aren't changed a bit.

    0 讨论(0)
  • 2021-02-13 13:30

    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.

    0 讨论(0)
提交回复
热议问题