Here is the code - thanks in advance
public class TestPerson
{
int ID { get; set; }
string FirstName { get; set; }
string LastName { get; set; }
string Hair { get; set; }
string Race { get; set; }
string Measurements { get; set; }
}
public class TestPersonContext : DbContext
{
public DbSet<TestPerson> TestPersons { get; set; }
}
Anonymous User
10-Nov-2014You should set one of your properties as the primary key. In your case this will be the ID property:
Btw why are all your properties private? It would be recommended to make all them publicly available, especially the primary key.
What is more there is something called Convention over Configuration which is used quite intensively in Entity Framework. One of the conventions is the Primary Key Convention which states: