一个庞大的类上的StackOverflowException

Vit*_*eis 0 c# asp.net stack-overflow oop

所以,我开始研究这个庞大的项目.这是一个巨大的类,有数百个变量和方法以及许多部分类.

interface IBusinessReturn
{

    string variableOne { get; set; }
    string variableTwo { get; set; }

    string variableHundred { get; set; }
    //a lot more...
 }

 public partial class BusinessTransaction : IBusinessReturn
{

    private string _variableOne;
    public string variableOne
    {
        get { return variableOne; }
        set { _variableOne= value; }
    }

    private string _variableTwo;
    public string variableTwo
    {
        get { return variableTwo; }
        set { _variableTwo = value; }
    }

    private string _variableHundred;
    public string variableHundred
    {
        get { return variableHundred; }
        set { _variableHundred = value; }
    }

    // And so it goes on till hundreds...
}
Run Code Online (Sandbox Code Playgroud)

还有很多其他的偏见:

public partial class BusinessTransaction: IBusinessTransaction238
{
   //Lots of methods
}
Run Code Online (Sandbox Code Playgroud)

问题是:除了我声明的一些新变量之外,它都在工作.(varOne和Two,在上面的例子中).当我尝试为这些var设置任何值时,我得到了一个StackOverflowException.我百分百肯定他们就像其他人一样被宣布.

这就是我打电话的方式:

 BusinessTransaction v763 = new BusinessTransaction();

 v763.variableHundred = "Hi"; //working
 v763.variableOne = "Hello"; //StackOverflow HERE.
Run Code Online (Sandbox Code Playgroud)

我只是看不出为什么会发生这种情况的任何原因,我只希望你能告诉我这是否与这个类的大量方法和变量有关.

Gra*_*ICA 11

看看你的吸气器 - 没有任何下划线.你造成了一个无限循环.

public string variableOne
{
    get { return variableOne; }
    set { _variableOne= value; }
}
Run Code Online (Sandbox Code Playgroud)