public static bool TryRetrieveDataForId(int id, out VolatileDataCache data) { try { return(_volatileDataCache.TryGetValue(id, out data)); } catch (Exception) { data = null; return(false); } }
public static void RegisterVolatileData(int id, VolatileDataCache data) { if (_volatileDataCache.ContainsKey(id)) { //We don't want to lose data here , only anime from seasonal contains genres data. if (data.Genres != null && data.Genres.Count > 0) { _volatileDataCache[id].Genres = data.Genres; } _volatileDataCache[id].DayOfAiring = data.DayOfAiring; _volatileDataCache[id].GlobalScore = data.GlobalScore; _volatileDataCache[id].AirStartDate = data.AirStartDate; } else { _volatileDataCache[id] = data; } }