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.

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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s