title: Why the C# property initializer (new()) is written as that?
body: <pre><code>    Info myPath = new Info()
      {
          path = oFile.FileName
      };
      ...
      class Info
      {
          public string path;
          public string Path
          {
              get { return path; }
              set { path = value; }
          }
      }
  </code></pre>
  
  <p>Above is the C# code from some program and it can work normally. But I don't understand it well. The first question is that why <code>path = oFile.FileName</code> is not written as <code>path = oFile.FileName;</code> ? Why the semicolon can be removed?</p>
  
  <p>The second question is that why I cannot write it like this: <code>myPath.path = oFile.FileName</code> ? There will give error message by Visual Studio 2012.</p>
  
  <p>Could anyone please help? Thanks!</p>