Solved

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

Posted on 2014-10-15
1
540 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now