title: System.StackOverflowException , when get set Properties are used?
body: <p>An unhandled exception of type 'System.StackOverflowException' occurred in wcfserviceLibrary.DLL</p>
  
  <p>the code is show as follows.</p>
  
  <pre><code>[DataContract]
  public class memberdesignations
  {
      [DataMember]
      public string DesigId
      {
          get { return DesigId; }
          set { DesigId = value;}
      }
      [DataMember]
      public string DesignationName
      {
          get { return DesignationName; }
          set { DesignationName = value; }
      }
  
  }
  </code></pre>
  
  <p>then i have method of Type memberdesignations as follows</p>
  
  <pre><code>public List&lt;memberdesignations&gt; memberdesignations()
      {
          List&lt;memberdesignations&gt; designations = new List&lt;memberdesignations&gt;();
          memberdesignations objmemDesignations;
          ds = objbll.Get_Member_Designations();
          DataView dv = new DataView();
          dv = ds.Tables[0].DefaultView;
          foreach (DataRowView drow in dv)
          {
              objmemDesignations = new memberdesignations();
              objmemDesignations.DesigId = drow["DesignationId"].ToString();
              objmemDesignations.DesignationName = drow["DesignationName"].ToString();
              designations.Add(objmemDesignations);
          }
          return designations;
      }
  </code></pre>
  
  <p>iam getting the error in the class containing the get set properties.</p>
  
  <p>But i was able to get rid of the error when i modified the class like this :</p>
  
  <pre><code> [DataContract]
  public class memberdesignations
  {
      [DataMember]
      public string DesigId
      {
          get;  set;
      }
      [DataMember]
      public string DesignationName
      {
          get; set;
      }
  }
  </code></pre>
  
  <p>On searching the forum , i found the cause for it was and explained by Konamiman
  <a href="https://stackoverflow.com/a/1672585/1054978">here</a></p>
  
  <p>i would like to know the difference between the two different ways for properties explained by Konamiman</p>
  
  <p>or any other explanation would be appreciated.</p>
  
  <p>Thanks</p>