public static DataTable Get(TableKey tableKey) { lock (_lock) { return(_cache.ContainsKey(tableKey.Value) ? _cache[tableKey.Value] : null); } }
public static void Put(TableKey tableKey, DataTable datatable) { lock (_lock) { if (Get(tableKey) != null) { throw new Exception(string.Format("'{0}' already exists", tableKey)); } _cache[tableKey.Value] = datatable; } }