I am trying to set fields in a database using the mvc3 method. When I run the program, I get
System.Data.Edm.EdmEntityType :: EntityType "CarModel" does not have a key. Define a key for this EntityType.
my model looks like
public class CarModel { public string VIN { get; set; } public string Make { get; set; } public string Model { get; set; } public string Year { get; set; } public string Color { get; set; } public string Mileage { get; set; } public string Description { get; set; } }
I saw where people add an identifier, but the database does not have an ID property. And when I try to add [Key] over VIN, which is the primary key in the database. This gives a red squiggly error under the key.
They seem to be missing a link.
Bryan source share