I think we need to see the code that modifies the Amount property.

If the property is protected, it has to be inside a method of the class (or one of its subclasses).

--------------------------------------------------
From: "CassioT" <[email protected]>
Sent: Thursday, January 28, 2010 5:04 AM
To: "nhusers" <[email protected]>
Subject: [nhusers] Re: Proxy and property modification

Hi Richard,

Like I said, take:

public virtual decimal Amount { get; protected set; }

Anything that I try to put in Amount is denied. If Amount == 0 and I
try something like Amount = 5, Amount will not be modified.

But like I said before, without the protected restriction or using
fetch="join" (many-to-one association) it works

I tested the same code with pure classes (No NHibernate interaction),
just to see if it was a .NET problem, and of course, it worked.

Thanks

On Jan 27, 8:19 pm, "Richard Brown \(gmail\)"
<[email protected]> wrote:
Hi,

Can you show the code that modifies the object?  (accesses the mutator)

Thanks,
    Richard

--------------------------------------------------
From: "CassioT" <[email protected]>
Sent: Wednesday, January 27, 2010 7:38 PM
To: "nhusers" <[email protected]>
Subject: [nhusers] Proxy and property modification



> Hi all.

> I have an entity that has a property that is defined like this:

> public virtual decimal Amount { get; protected set; }

> I don't know why but I can't modify it. The value never change.

> I found two ways to fix it.

> 1) Don't use the proxy version (fetch="join") - Never mind
> 2) Remove the protected restriction

> Am I doing something wrong or do I have any other alternative?

> I tried to access="field" too.

> Thanks

> --
> 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.

--
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.



--
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