In your class, the model you need to add the attribute Required
. As EF consider the first one as the key, that is why you only have for the first one:
Try like this:
public partial class Business
{
[Key] //And this one should be the key
public int BusinessKeyId { get; set; }
[Required]
public string BusinessName { get; set; }
[Required]
public string BusinessType { get; set; }
[Required]
public int ContactId { get; set; }
public virtual Contact Contact { get; set; }
}
Note for the first property your BusinessKeyId
you could also let the database generate that to avoid duplicate. If you want that just ask so I can Edit my answer. But for now I think It should work.