DatabaseGeneratedOption does not Exist error after upgrading to Entity Framework 5.x RC or .NET Framework 4.5

Like so many others over the weekend I upgraded to the last RC builds of various Visual Studio 2012 related products.  While updating my Web Api sample project ChlodnyWebApi I ran into one error when upgrading to Entity Framework 5 RC (not bad if you ask me).

The name 'DatabaseGeneratedOption' does not exist in the current context

Looks like this was moved in this version.  Add the following using statement:

using System.ComponentModel.DataAnnotations.Schema;

 

The System.ComponentModel.DataAnnotations.Schema namespace provides support for attribute classes that are used to define metadata for ASP.NET MVC and ASP.NET data controls.

Advertisements
This entry was posted in Entity Framework and tagged . Bookmark the permalink.