View Single Post
  #4 (permalink)  
Old March 21st, 2013, 10:59 PM
Rohan Parkes Rohan Parkes is offline
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm encountering this problem too. I was in fact also making the mistake of typing in the fully-qualified name, but unfortunately, using "MusicStoreDB" didn't fix it for me. I still get the error message about not having an id. I've also tried adding the [Key] data annotation. This didn't help, (and shouldn't be necessary in this situation anyway).

According to NuGet, I have Entity Framework 5 installed.

UPDATE: I got it to work. As someone pointed out in another thread, you need to recompile the project after adding your classes and before generating the controller. There was actually some indication of this in the text when it was mentioned that the MVC tools use reflection. Of course, the classes need to be compiled for this to work.

Last edited by Rohan Parkes; March 21st, 2013 at 11:47 PM..