First: Apologies for my English.
Secondly: I had the same problem with the first code model, which creates foreign keys in this way: public virtual Collection<Object> Objects {get; set;} public virtual Collection<Object> Objects {get; set;}
and I found a workaround by setting the setter property as private:
public virtual Collection<Object> Objects {get; private set;}
Then EF cannot populate the Objects collection, because with the help of a private set you can only assign a value in the constructors.
Nathan lahy
source share