Property setter and property getter injection

Jan 14, 2011 at 3:18 PM

Hello I'm very new to cci, and i want to ask you some question?

I've a lot of entity classes with entitiy attributes marked with [DBField] attribute.

And I want to call additional method defined in the base class, before get and set value of the property.

Lets assume that i have the following code:

public class Foo
        {
            private int val;
            [DBField]
            public int Val
            {
                get
                {
                    return val;
                }
                set
                {
                    this.val = value;
                }
            }
        }
I want to achieve this functionality:
public class Foo
        {
            private int val;
            [DBField]
            public int Value
            {
                get
                {
                    lc();//newly added method
                    return val;
                }
                set
                {
                    lc();//newly added method
                    this.val = value;
                }
            }
        }
Can I inject code to property getters and property setters?
Thanks a lot!
Nikola