At http://msdn.microsoft.com/en-us/library/dd468057.aspx I read that all navigation properties for which I would like to have a change tracking proxy need to be public
and virtual
. From what I understand, the CLR creates subclasses of my POCOs dynamically, and it re-implements the properties to provide the requested behaviour.
For this I undertand that the property needs to be virtual
, and that it should have protected
or higher accesability. However, if I want to use these for convenience within the assemby, but don't want to expose them, I prefer them not to be public
. Which leads me to two questions.
(for my understanding of what is going on) why does the runtime require the properties to be
public
rather thanprotected
orinternal
?(for my actual situation) are there any workarounds to hide the navigation property, but still have the change tracking behaviour?