title: C# dynamic attributes
body: <p>I found this code on this Microsoft page: <a href="https://blogs.msdn.microsoft.com/mcsuksoldev/2010/02/04/dynamic-xml-reader-with-c-and-net-4-0/" rel="nofollow">Microsoft Dynamic XML Parser</a></p>
  
  <pre><code> public string this[string dbName]
      {
          get
          {
              return xmlSQL.Attribute(dbName).Value;
          }
      }
  </code></pre>
  
  <p>i would like to use this funcionality but instead of just returning an object like in the Microsoft example i like to receive a predefined Type.</p>
  
  <pre><code>DynamicXmlParser parser = new DynamicXmlParser(@".\order.xml");
  int s = parser.element;
  </code></pre>
  
  <p>and my intellisense and the compiler knows what he will get.</p>