Hi all.
Just a note, hope it can be useful to someone.
I am using a bag to map data and wanted only a readonly version to be available to outside objects. To do so, i used the following property:
Code:
public IList<Session> Sessions {
get { return new ReadOnlyCollection<Session>(sessions); }
private set {
sessions = value;
RegisterSessions();
}
private IList<Session> sessions;
By doing so, at one point, NH made sessions the readonly version of itself... making adding sessions impossible, even for the object itself.
Instead, i made a fully private property for sessions and a separate readonly public property.
This caused me some headache... hope i can save the trouble to someone else.
jacques.