I have a method that has a signature that looks like this:
public IList<T> GetReferenceData<T>(TransactionManager transactionManager = null) { IList<T> collection; var cacheData = DataCacheManager.Instance.GetCacheItem(typeof(T).Name); if (cacheData != null) { collection = (IList<T>)cacheData; } else { collection = this.GetReferenceDataNoCache<T>(transactionManager); DataCacheManager.Instance.AddCacheItem(typeof(T).Name, collection); } return collection; } 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.
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<?>(); } What replaces the question mark?
GetReferenceData<T>body?