title: Invoke method on static filed using IL generator in C# reflection
body: <p>I'm generating a new <code>Type</code> via <code>TypeBuilder</code> from C# reflection. The problem that I have right now is how to build method body to invoke method on static filed.</p>
  
  <p>Right now my generated (at runtime) class looks like this:</p>
  
  <pre><code>public class Generated
  {
      static private MyObject obj;
  
      public MyResponse Hello(MyRequest req1)
      {
          return obj.Hello(req1); // this part need to be grnerated
      }
  }
  </code></pre>
  
  <p>So right now I'm generating method like this:</p>
  
  <pre><code>MethodBuilder mb = tb.DefineMethod(
      methodInfo.Name,
      MethodAttributes.Public | MethodAttributes.Final,
      CallingConventions.HasThis | CallingConventions.ExplicitThis,
      methodInfo.ReturnType,
      arguments);
  
  ILGenerator il = mb.GetILGenerator();
  il.Emit(OpCodes.Ldnull); // right now I'm just simply returning null
  il.Emit(OpCodes.Ret);
  </code></pre>
  
  <p>So please tell me how can I load static field on stack in Il generator and then invoke certain method on it. </p>