protected LastfmData <T> Get <T> (string fragment, string xpath) where T : DataEntry { if (cache.ContainsKey(fragment)) { return((LastfmData <T>)cache [fragment]); } LastfmData <T> obj = new LastfmData <T> (String.Format("artist/{0}/{1}", name, fragment), xpath); cache [fragment] = obj; return(obj); }
protected LastfmData <T> Get <T> (string fragment, string xpath) where T : DataEntry { //using cacheKey because the public methods all use the same fragment but with a different xpath. string cacheKey = fragment + xpath; if (cache.ContainsKey(cacheKey)) { return((LastfmData <T>)cache [cacheKey]); } LastfmData <T> obj = new LastfmData <T> (String.Format("album/{0}/{1}/{2}", artist, album, fragment), xpath); cache [cacheKey] = obj; return(obj); }