The entity type 'DisplayFormatAttribute' requires a primary key to be defined.
In my case I figured out the problem was that I used properties like this:
public string LastName { get; set; } //OK
public string Address { get; set; } //OK
public string State { get; set; } //OK
public int? Zip { get; set; } //OK
public EmailAddressAttribute Email { get; set; } // NOT OK
public PhoneAttribute PhoneNumber { get; set; } // NOT OK
Not sure if there is a better way to solve it but I changed the Email and PhoneNumber attribute to a string. Problem solved.