According to Why do navigation properties have to be public for a proxy to be created? a navigation property can be protected internal virtual and does not need to be public virtual and Entity Framework will still supply proxies. I have programmed a navigation property like this:
protected internal virtual ICollection<MyEntityType> MyNavigationCollection { get; set; }
In the mapping I obviously have:
.WithMany(t => t.MyNavigationCollection )
This seems to be in line with the article I referenced. The problem I have is, that Entity Framework no longer assigns an instance of a proxy collection to MyNavigationCollection when I query for the owning object, as I have changed the visibility to protected internal virtual for MyNavigationCollection .
What do I miss in order to have Entity Framework to use proxy objects for collections having the visitility protected internal virtual?