title: C# getter setter default value
body: <p>How do you set default value for setter getter? I want to do some operations while setting the setter.</p>
  
  <pre><code>public bool spin {
      get { return this.spin; }
      set {
          if (value == false) this.spinBack = true;
          this.spin = value;
      }
  }
  private bool spinBack;
  </code></pre>
  
  <p>I tried this on Unity3D and got this error when trying to do so.</p>
  
  <blockquote>
    <p>StackOverflowException: The requested operation caused a stack
    overflow.</p>
  </blockquote>
  
  <p>I tried just setting the getter and leave getter as default like so </p>
  
  <pre><code>public bool spin {
      get;
      set {
          if (value == false) this.spinBack = true;
          this.spin = value;
      }
  }
  private bool spinBack;
  </code></pre>
  
  <p>but I get this error </p>
  
  <blockquote>
    <p>'spin.get' must have a body because it is not marked abstract, extern,
    or partial</p>
  </blockquote>