How quickly locate fields whom amended

How quickly locate fields whom amended

The origin of demand

  • Data class field does not know by whom changed (since there are hundreds of references to modify at all inconvenient to every place breakpoints)

Implementation code

  • The original class
public class data
{
    public int id;//需要定位被谁修改的字段
}
  • Modified
public class data
{
    public int ID;
    public int id
    {
        get { return ID; }
        set
        {
            if (true)//添加断点条件
            {
                ID = value;
            }
            ID = value;
        }
    }
}

Guess you like

Origin www.cnblogs.com/zouqiang/p/11021384.html