In Entity Framework 4.3.1 I had the following Models, and they worked fine:
public class BaseUser
{
[Key]
[MaxLength(100)]
public string Username { get; set; }
}
[Table("AppUser")] // Ensures EF Code First uses Table-per-Type
public class AppUser : BaseUser
{
[MaxLength(200)]
public string About { get; set; }
}
After upgrading to EF 5.0, I get the following exception when I try to run this application and access the associated DbContext:
EntityType 'AppUser' has no key defined. Define the key for this EntityType.
How do I resolve this issue? This appears to be a regression.