This project is read-only.
1
Vote

Implement On Property Change for POCO

description

Implement the on property change pattern for scalar entities

comments

apocolpse wrote Apr 1, 2011 at 9:42 PM

or at least make them optional

JohannesHoppe wrote Apr 4, 2011 at 11:40 PM

Could you provide a code example, please?!

apocolpse wrote Apr 6, 2011 at 9:23 PM

I'm proposing something like this property declaration
public partial class Category {
public global::System.Int32 CategoryID
    {
        get
        {
            return _CategoryID;
        }
        set
        {
            if (_CategoryID != value)
            {
                OnCategoryIDChanging(value);                  
                _CategoryID = value;
                OnCategoryIDChanged();
            }
        }
    }

    private global::System.Int32 _CategoryID;
    partial void OnCategoryIDChanging(global::System.Int32 value);
    partial void OnCategoryIDChanged();
}

wrote Feb 13, 2013 at 2:35 AM