title: Invoke a member of a dynamic object with a name defined at runtime in a String
body: <p>I want to access a property on an object while leveraging the DLR binding mechanism.</p>
  
  <ul>
  <li>I cannot use the native binding mechanism (<code>dynamic</code> keyword in C#) because I do not know the property name at compile-time;</li>
  <li>I cannot use reflection because it only retrieves static type information; </li>
  <li>casting to an <code>IDictionary&lt;string, object&gt;</code>, to my knowledge, only solves the case of dynamic classes that choose to implement that interface (such as <code>ExpandoObject</code>).</li>
  </ul>
  
  <p>Here is the demonstration code:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          dynamic obj = new System.Dynamic.ExpandoObject();
          obj.Prop = "Value";
          // C# dynamic binding.
          Console.Out.WriteLine(obj.Prop);
          // IDictionary&lt;string, object&gt;
          Console.Out.WriteLine((obj as IDictionary&lt;string, object&gt;)["Prop"]);
          // Attempt to use reflection.
          PropertyInfo prop = obj.GetType().GetProperty("Prop");
          Console.Out.WriteLine(prop.GetValue(obj, new object[] { }));
          Console.In.ReadLine();
      }
  </code></pre>