none
Add Controller - no key defined RRS feed

  • Question

  • I have an MVC 3 Project and have created the model from a database.  I am using Entity Framework 4.1.  I am fine up to add a controller.  I have scaffolding options that I see are not in most of the video tutorials.  I am adding a Controller with read/write actions and views, using Entity Framework.  I select the model class and then add a new data context class based on the format provided and using the class as shown in the Model1.tt cs class file.  But I get an error showing that a key has not be defined for about 10 or more tables out of about 30 tables.  I have checked the XML file for the edmx file and there is a key for each table.  I have also validated the database in SSMS and checked the design and see the primary keys for each table.  Am I misinterpreting this error? 
    Seth Thomas
    Friday, September 30, 2011 8:43 PM

All replies