How to declare one to one relationship using Entity Framework 4 Code First (POCO)
Three methods: A) Declare both classes with navigation properties to each other. Mark one of the tables (the dependent table) with the ForeignKey attribute on its Primary Key. EF infers 1-to-1 from this: public class AppUser { public int Id { get; set; } public string Username { get; set; } public OpenIdInfo OpenIdInfo { … Read more