How to declare a one to one relationship using Entity Framework 4 Code First (POCO)?
I found this question (one-to-one relationships in Entity Framework 4) , but the
public class User
{
public int Id { get; set; }
public string Username { get; set; }
public virtual Profile Profile { get; set; }
}
public class Profile
{
public int Id { get; set; }
public int UserID { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string PostalCode { get; set; }
}
Add the virtual Profile and the UserID and I think that should get you there.