I remember the last version of EF wasn't supporting protected or private collection mapping like NHibernate does.
You had to do something like that
public class Post
{
...
public virtual ICollection<Tag> Tags { get; private set; }
Is there a way to avoid someone from calling this collection directly ? i would prefer encapsulating it in a method instead to have full control on it. However this was needed by EF in order to do the relationship. Was this changed ?
EDIT: Normally we should be able to use IEnumerable instead of ICollection (as it is supported with NHibernate) but it seem not supported in EF.
Thanks.