Entity Framework for Portable Class Library

I'm trying to create a Repository, Entity framework for a Portable Class Library, when I ever try to execute a Nuget EntityFramework

Failed to add a link to "System.ComponentModel.DataAnnotations". Make sure it is in the global assembly cache.

Any idea to solve this problem for EF

Compatible EF Package for Portable Library

+7
c # windows-8 silverlight entity-framework windows-phone-8
source share
3 answers

EF7 has PCL, so if anyone planning to use PCL can use an earlier version of EF7 or VS2014

+3
source share

You can freely use Api, do not use annotations and data attributes in the model class.

Example: to determine the primary key; instead of using the [Key] tag, use:

 protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<Record>().HasKey<int>(s => s.ID); } 
+4
source share

Prior to Visual Studio Update 2, you can create a PCL project that targets clean .Net 4 or .Net 4.5 and Windows 8, which will allow you to install the EntityFramework nuget package. After this update, you cannot target Windows 8 without automatically connecting Windows Phone 8.1.

This automatic targeting on Windows Phone does not seem to allow adding the EF package to PCL designed for Windows 8.

+3
source share

All Articles