Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 719
  • Last Modified:

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

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
yguyon28
Asked:
yguyon28
1 Solution
 
SammyCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now