EF-Code first complex type with a navigational property
My Model: public class Country { public int CountryId { get; set; } public string Name { get; set; } public virtual ICollection<User> Users { get; set; } } public class Location { public string Address { get; set; } public virtual int CountryId { get; set; } public virtual Country Country { get; set; } } public class User{ protected User() { Location = new Location(); } public int UserId { get; set; } public Location Location { get; set; } } When generating the database, I get: One or more validation errors were detected during model generation: System.Data.Edm.EdmEntityType: : EntityType