title: Dynamically getting default of a parameter type
body: <h2>Question</h2>
  <p>I am trying to dynamically get the default for a type that is specified in a ParameterInfo. _methods[methodName] returns a MethodInfo object.</p>
  <p>Unfortunately, the compiler doesn't like the &quot;paramType&quot; bit inside the default(paramType). I'm stumped.</p>
  <h2>Error</h2>
  <blockquote>
  <p>The type or namespace name 'paramType' could not be found (are you missing a using directive or an assembly reference?)</p>
  <p>C:\Applications\...\MessageReceiver.cs Line 113</p>
  </blockquote>
  <h2>Example</h2>
  <pre><code>object blankObject = null;
  foreach (var paramInfo in _methods[methodName].Key.GetParameters())
  {
      if (paramInfo.Name == paramName)
      {
          Type paramType = paramInfo.ParameterType;
          blankObject = (object)default(paramType);
      }
  }
  parameters[i] = blankObject;
  </code></pre>