I am new to entity framework. I have following models.
public partial class PropertyDetail
{
public int PropertyID { get; set; }
public string PropertyName { get; set; }
public virtual PropertyAddress PropertyAddress { get; set; }
public string AnalyticsView { get; set; }
public string MoreInformationLink { get; set; }
}
public class PropertyAddress
{
public string PropertyName { get; set; }
public string StreetAddress { get; set; }
public string PostalCode { get; set; }
public virtual PropertyDetail PropertyDetail { get; set; }
}
I want PropertyID from PropertyDetail to be primary key and PropertyName to be Foreign key in PropertyAddress table.
Thank for help.
with EF6 you can't: the FK must be of the same type as the PK. I heard about that in EF7 but not for sure.