Entity Framework 7 in Xamarin.Forms

Entity Framework 7 is currently available in beta and this article says what should it be?) You can use Entity Framework 7 in Xamarin projects.

However, when I try to install it using NuGet:

Install-Package EntityFramework.SQLite โ€“Pre 

This will fail:

 Install-Package : Could not install package 'EntityFramework.Sqlite 7.0.0-beta6'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package EntityFramework.SQLite โ€“Pre + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand 

Can I use the Entity Framework in a Xamarin project or will I have to stick to sqlite-net ?

Edit: As @Daniel Luberda suggested, I just tried installing the Entity Framework into a project created from the Shared Project Xamarin.Forms template, but this fails with the following error:

 Install-Package : Could not install package 'System.Runtime 4.0.20-beta-23109'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v5.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package EntityFramework.SQLite โ€“Pre + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand 

The same can be said about the Windows Phone project and the iOS project.

+6
source share
2 answers

I just looked at Nupkg EF7 and it looks like they don't have platform specific compilations.

This is also confirmed by the roadmap , which states:

The November Release Candidate (RC1) will be a supported and ready-to-release cross-platform version. Depending on the feedback from RC1, we send candidates for an additional issue as necessary.

RC1 is currently scheduled for November15. Most likely, you need to wait for this version before you can use the nuget package.

At the same time ... you can try to create the github source code for the target PCL 78, but I suspect that it will not be worth your time.

In any case, if you adhere to good MVVM methods, you should be able to create significant parts of your application and, if necessary, replace the data interface.

+6
source

It was proposed to be implemented in EF 7 or now EF core 1.0, but there is no clear roadmap for it, perhaps if more people ask for it in their applications, this will prompt MS to do this:

Support for EF 7 Xamarin.Forms

https://github.com/aspnet/EntityFramework/issues/4269

+2
source

All Articles