title: C# Properties as Reference
body: <p>Basic fundamental I messed up with C# Properties and reference types.</p>
  
  <pre><code>public Address adr { get; set; }
  
  public class Address
  {
  
      //Field
      public string AddressLine1;   
  
      //Property
      public string Country {get; set;}
  }
  
  public void ChangeCountry(string _Country)
  {
      _Country = "US";
  }
  
  public void ChangeAddress(Address _adr)
  {
      _adr.Country = "US";
  }
  
  private void button1_Click(object sender, EventArgs e)
  {
      adr = new Address();
      ChangeCountry(adr.Country);
  
      MessageBox.Show(adr.Country);
      //(?)Country is reported empty string. Property did not updated outside.
  
      ChangeAddress(adr);
  
      MessageBox.Show(adr.Country);
      //OK. Country is reported 'US'
  
  
  }
  </code></pre>
  
  <p>Here my questions;</p>
  
  <ol>
  <li><p>When we pass a Property(simple or complex one) directly to a method that will attempt to modify it, <strong>Is it ensured this property modified everywhere</strong>? I mean Like the <strong>ref</strong> keyword? Since I can't use the "ref" keyword with properties;I directly pass property to a method for modification and I'm not sure if it is always going to be updated/modified also at outside. When I dont see ref keyword; it makes me worried :)</p></li>
  <li><p>In the above example; adr class is updated successfully(ChangeAddress) without ref keyword; but the ChangeCountry method could not updated the string Country property. Is this a special case for strings?</p></li>
  </ol>