title: Pass a dynamic variable in a static parameter of a method in C# 4
body: <p>This is what I am trying to do:</p>
  
  <pre><code>public void method(int myVal, string myOtherVal)
  {
    // doing something
  }
  
  dynamic myVar = new SomeDynamicObjectImplementer();
  method(myVar.IntProperty, myVar.StringProperty);
  </code></pre>
  
  <p>Note that my properties are also DynamicObjects. My problem is that the TryConvert method is never called and that I get a runtime error saying the method signature is invalid.</p>
  
  <p>The following is working great:</p>
  
  <pre><code>string strVar = myVar.StringProperty;
  int intVar = myVar.IntProperty;
  </code></pre>
  
  <p>And I would like to avoid </p>
  
  <pre><code>method((int)myVar.IntProperty, (string)myVar.StringProperty);
  </code></pre>
  
  <p>Is it possible to override something in DynamicObject to allow this? (or something else)</p>
  
  <p>Thank you</p>