public T InquiryDataWithMethod <T>(ArrayList info, FetchMethod <T> method) where T : class, new() { if (!this.Available) { return(null); } if (this.CacheEnabled) { object cachedValue = Cache.GetCachedObject(method, info); if (cachedValue != null && cachedValue is T) { return(cachedValue as T); } } object result = method(DataSource, info); if (this.CacheEnabled) { Cache.CacheObject(method, info, result); } return(result as T); }
public T InquiryData <T>(ArrayList info) where T : class, new() { if (!FetchMethods.ContainsKey(typeof(T))) { return(null); } FetchMethod <T> method = FetchMethods[typeof(T)] as FetchMethod <T>; return(InquiryDataWithMethod(info, method)); }
protected void RegisterMethod <T>(FetchMethod <T> method) where T : class, new() { FetchMethods[typeof(T)] = method; }