View Single Post
  #2 (permalink)  
Old November 1st, 2013, 06:41 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I don't have the book, so I can't tell for sure what's going on. Does the sample use EF Code First (where you define the classes and then EF creates the database) or Database First (where you define the database and EF creates the classes)? In the former case, your class seems to miss an Id property (named Id, or something else but then it needs to be configured as a key). In the latter case, it seems that the database is missing the Id column.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote