private AddOrUpdate ( |
||
key | 主键,不能为空 | |
foreignKey | 外键,可以为空 | |
dataMessage | byte | 数据值 |
cacheVersion | long | |
return | void |
/// <summary> /// 添加或更新 /// </summary> /// <param name="msgId">数据类型ID</param> /// <param name="key">Key</param> /// <param name="dataMessage">待添加的数据对象</param> internal void AddOrUpdate(int msgId, KeyString key, KeyString foreignKey, byte[] dataMessage, long cacheVersion = InnerCacheSystem.InitialCacheVersion) { InnerCacheTable tableCache = null; m_CacheTableDict.TryGetValue(msgId, out tableCache); if (tableCache != null) { tableCache.AddOrUpdate(key, foreignKey, dataMessage, cacheVersion); } else { InnerCacheTable newTableCache = new InnerCacheTable(); newTableCache.AddOrUpdate(key, foreignKey, dataMessage, cacheVersion); m_CacheTableDict.Add(msgId, newTableCache); } }
/// <summary> /// 添加或更新 /// </summary> /// <param name="msgId">数据类型ID</param> /// <param name="key">Key</param> /// <param name="dataMessage">待添加的数据对象</param> internal void AddOrUpdate(int msgId, KeyString key, KeyString foreignKey, byte[] dataMessage, long cacheVersion = InnerCacheSystem.InitialCacheVersion) { InnerCacheTable tableCache = null; m_CacheTableDict.TryGetValue(msgId, out tableCache); if (tableCache != null) { tableCache.AddOrUpdate(key, foreignKey, dataMessage, cacheVersion); } else { InnerCacheTable newTableCache = new InnerCacheTable(); newTableCache.AddOrUpdate(key, foreignKey, dataMessage, cacheVersion); m_CacheTableDict.Add(msgId, newTableCache); } }