I'd like to create an aspect that throws an exception if a field's value is changed after a value has been set. So, if the field's value is not null, changing the value should throw an exception.

It doesn't seem like this can be implemented as a constraint aspect, because I can't read the current field value in constraint aspects. Any ideas?

asked Jan 26 '11 at 00:32

ara's gravatar image


One Answer:

You can: use protected GetPropertyValue method of PropertyConstraintAspect.

answered Jan 26 '11 at 05:10

Alex%20Yakunin's gravatar image

Alex Yakunin

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview


Once you sign in you will be able to subscribe for any updates here



Asked: Jan 26 '11 at 00:32

Seen: 2,132 times

Last updated: Jan 26 '11 at 05:10

powered by OSQA