Hi all, I've run into a strange issue. Basically, I created my new application called input-outputTest, created my model class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace input_outputTest.Models
{
public class EmployerDetails
{
private string Name { get; set; }
private string Surname{ get; set; }
private int Age { get; set; }
private int EmployerNumber { get; set; }
}
}
And as I attempted to create a controller called EmployeeController "with read/write actions and view using EF" - screenshot here
I got an error message saying:
"Unable to retrieve metadata for 'input_outputTest.Models.EmployerDetails'. One or more validation errors were detected during model generation;
-System.Data.Entity.Edm.EdmEntityType::EntityType 'EmployerDetails' has no key defined. Define the key for this Entity Type
-System.Data.Entity.Edm.EdmEntitySet:EntityType:EntitySet EmployerDetails is based on type 'EmployerDetails' that has no key defined"
Screenshot here:
Now, before you say "well then insert the key", please note that I have never had to do that before. Rather, I wonder if there is anything stupid I've done. I was planning to add the controller and then the view, so all I have now is the model. ANy idea?!