Is EntityFramework available for Windows 8 Store Apps?

前端 未结 4 1583
深忆病人
深忆病人 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.

提交回复
热议问题