title: C# 6 auto-properties - read once or every time?
body: <p>I follow a pattern when setting certain properties whereby I check to see if the corresponding field is empty, returning the field if not and setting it if so.  I frequently use this for reading configuration settings, for example, so that the setting is read lazily and so that it is only read once.  Here is an example:</p>
  
  <pre><code>private string DatabaseId
  {
      get
      {
          if (string.IsNullOrEmpty(databaseId))
          {
              databaseId = CloudConfigurationManager.GetSetting("database");
          }
  
          return databaseId;
      }
  }
  </code></pre>
  
  <p>I have started to use C# 6 autoproperty initialization as it really cleans up and makes my code more concise.  I would like to do something like this:</p>
  
  <pre><code>private string DatabaseId { get; } = CloudConfigurationManager.GetSetting("database");
  </code></pre>
  
  <p>But I'm not sure how the compiler interprets it in this case.  Will this have the same effect as my first block of code, setting the (automatically implemented) field once, and thereafter reading from the field?  Or will this call the <code>CloudConfigurationManager</code> every time I get <code>DatabaseId</code>?</p>