Solved

MasterList: EntityType 'MasterList' has no key defined. Define the key for this Entity Type

Posted on 2014-10-15
1
583 Views
Last Modified: 2014-10-16
When I try to add a new controller as a scaffolding items, I get this error?

MasterList: EntityType 'MasterList' has no key defined. Define the key for this Entity Type....
0
Comment
Question by:yguyon28
1 Comment
 
LVL 27

Accepted Solution

by:
Sammy earned 500 total points
ID: 40382921
You need to define a key

public class MasterList
    {
        [Key] //See Key here!!
        [StringLength(8)]
        public string MasterListID { get; set; }

        [DisplayName("List Name")]
        [StringLength(50)]
        public string Name { get; set; }
    }

Open in new window

0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to refer to value 8 51
2 questions 10 25
What can cause the styling on a .NET site to not be found? 17 27
Where did System.Data.Objects go? 2 29
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question