I have the below tables as my entities
public class Customer
{
public int CustId{get;set;}
public string Name {get;set;}
}
public class Address
{
public int Id{get;set;}
public string Name {get;set;}
**public virtual Customer Customer {get;set;}**
}
In my model configuration for Address using Fluent API. I have the below code
HasKey(p => p.Id);
HasRequired(p => p.Customer).WithMany().Map(m => m.MapKey("CustId"));
What I really want is instead of using
public virtual Customer Customer {get;set;}
I want to have Public Int CustID; property in Address Class... and still do the mapping
as foreign key.
Could someone please throw some suggestions...