title: How to convert a string to generic Type
body: <p>I have a method that has a signature that looks like this:</p>
  
  <pre><code>public IList&lt;T&gt; GetReferenceData&lt;T&gt;(TransactionManager transactionManager = null)
  {
      IList&lt;T&gt; collection;
      var cacheData = DataCacheManager.Instance.GetCacheItem(typeof(T).Name);
      if (cacheData != null)
      {
          collection = (IList&lt;T&gt;)cacheData;
      }
      else
      {
          collection = this.GetReferenceDataNoCache&lt;T&gt;(transactionManager);
          DataCacheManager.Instance.AddCacheItem(typeof(T).Name, collection);
      }
  
      return collection;
  }
  </code></pre>
  
  <p>I have another method that allows me to pass in a string, which converts that string to the appropriate type. I then want to call the above method.</p>
  
  <pre><code>public IList GetReferenceDataByType(string referenceType)
  {
          // this works and returns the appropriate type correctly
          var type = this.GetEntity(referenceType); 
  
          // now I'm stuck
          return this.GetReferenceData&lt;?&gt;();
  }
  </code></pre>
  
  <p>What replaces the question mark?</p>