Going through the Tutorial v2.0, I’ve just added data access to the sdf database. When I click on the Stores link after running the app, I get an ArgumentNullException on the following line in my StoreController:
var genres = storeDB.Genres.ToList();
In the watch window, I’m seeing that the StoreDB is not null, but the Albums & Genres are null. At first I thought this was a connection string issue, but I’ve pulled the database from the completed code file along with the connection string. Running the complete solution works fine, but mine fails as described above. I’m not seeing any differences in the code I entered. In fact, most of what I entered was copied and pasted.
How do I zero in on what the actual problem is?
The class MusicStoreEntities was not inheriting from DbContext. IOW, I had left off :DbContext from the class definition and did not notice it: