title: Best practice to ensure member variable string is uppercase in c# (getter toUpper)
body: <p>So I wanted to pose this question to you guys, its a simple thing but i wanted to find a better way.</p>
  
  <p>We have data that should always be uppercase but we allow lower case inputs that should be converted.</p>
  
  <p>Normally we would just do a <code>toUpper</code> when we save to the DB.</p>
  
  <p>I was thinking it might be better to <code>toUpper</code> in the getter, that way the logic is tighter to the data and as long as you use the Object to view this data then it will always be uppercase.</p>
  
  <pre><code>public string Mapping
  { 
      get
      {
          return mapping  == null ? mapping : mapping.ToUpper();
      }
      set;
  }
  </code></pre>
  
  <p>Is this dumb? I know <code>Mapping.ToUpper()</code> will create a new string each time, so it seems dumb. Any other suggestions?</p>