Actually it's not a bug ... it's just that the C# compiler is silently dropping 
the 'virtual' modifier on the mutator (changing it to protected should keep the 
'virtual' modifier).

Because the 'Total' property mutator is marked as private, the proxy is 
powerless to intercept it; I think your code was setting the property on the 
proxy and not the 'real' instance.

http://broloco.blogspot.com/2008/01/nhibernate-identity-map-and-proxies.html



From: Richard Brown (gmail) 
Sent: Wednesday, January 20, 2010 8:48 AM
To: [email protected] 
Subject: Re: [nhusers] Proxy Interfering With Property Setter / Getter


Can you try changing:

               public virtual int Total { get; private set; }
to
               public virtual int Total { get; protected set; }


Let me know if this fixes the problem (without requiring the Load() call) ... I 
suspect it might be a bug in the proxy validator.



From: Eric Anderson 
Sent: Wednesday, January 20, 2010 8:03 AM
To: [email protected] 
Subject: Re: [nhusers] Proxy Interfering With Property Setter / Getter


Fixed it, but not sure why this was required...

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to