title: Generic Method Executed with a runtime type
body: <p>I have the following code:</p>
  
  <pre><code> public class ClassExample
  {
  
      void DoSomthing&lt;T&gt;(string name, T value)
      {
          SendToDatabase(name, value);
      }
  
      public class ParameterType
      {
          public readonly string Name;
          public readonly Type DisplayType;
          public readonly string Value;
  
          public ParameterType(string name, Type type, string value)
          {
              if (string.IsNullOrEmpty(name))
                  throw new ArgumentNullException("name");
              if (type == null)
                  throw new ArgumentNullException("type");
  
              this.Name = name;
              this.DisplayType = type;
              this.Value = value;
          }
      }
  
      public void GetTypes()
      {
          List&lt;ParameterType&gt; l = report.GetParameterTypes();
  
          foreach (ParameterType p in l)
          {
              DoSomthing&lt;p.DisplayType&gt;(p.Name, (p.DisplayType)p.Value);
          }
  
      }
  }
  </code></pre>
  
  <p>Now, I know I cannot perform DoSomething()
  is there any other way to use this function?</p>