前一节讲了一下如何将缓冲实体放入cache中
接下来 看看对cache的其它一些操作
[此处的使用的数据对象为entitydata,可以根据需要改成你的数据对象.]
GetCacheEntity
/// <summary>
/// 取出对应的缓冲区的数据实体
/// </summary>
/// <param name="id"></param>
/// <param name="entityname"></param>
/// <returns></returns>
EntityData entity;
entity = cm.GetData(EntityKeyCreator.CreateKey(entityname,id)) as EntityData;
return entity;
/// <summary>
/// 删除指定缓存实体
/// </summary>
/// <param name="entity"></param>
cm.Remove(EntityKeyCreator.CreateKey(entity));
/// <summary>
/// 清除缓存
/// </summary>
cm.Flush();
博客介绍了对cache的操作,在前文将缓冲实体放入cache基础上,展示了取出缓冲区数据实体、删除指定缓存实体以及清除缓存的操作,使用的数据对象为entitydata,可按需修改。

被折叠的 条评论
为什么被折叠?



