Getting StackOverflowException when setting property

限于喜欢 提交于 2019-11-29 17:07:27

You are setting the value of the property by calling the property setter again, instead of directly setting its backing field. This causes an infinite recursion and a stack overflow as a result.

public int idEmpleado
{
    get { return _idEmpleado; }
    set { idEmpleado = value; } // SHOULD BE _idEmpleado = value
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!