之前写了不少关于仓储的文章,所以,自己习惯把自己叫仓储大叔,上次写的XMLRepository得到了大家的好评,也有不少朋友给我发email,进行一些知识的探讨,今天主要来实现一个RedisRepository,它始终是集成IRepository接口的,我这里的Redis仓储主要服务为复杂类型的业务,对于只存string这种需求,不需要使用它。
对于Redis仓储和说,它与XML仓储有些不同,由于XML文件一般存储在WWW服务器,所以没有网络通讯问题,而redis一般部署在第三台服务器上,我们一般称为NoSQL服务器,它与WWW通讯是通过socket协议完成的,正是如些,我们在进行仓储设计时,应该考虑到如何去释放它的资源,因为这种资源是非托管的,所以需要人为干预一下,.net提供了using关键字来做这事,而每个动作写using这显然是不友好的,所以,我这个redis仓储是在析构方法里完成对资源的销毁的,请看源代码:
首先是redis基类,它是实现统一操作的前提
/// <summary>
/// Redis实体基类,所有redis实体类都应该集成它
/// </summary>
public abstract class RedisEntity
{
public RedisEntity()
{
RootID = Guid.NewGuid().ToString();
}
/// <summary>
/// Redis实体主键,方法查询,删除,更新等操作
/// </summary>
public virtual string RootID { get; set; }
}
下面才是RedisRepository仓储的代码
/// <summary>
/// Redis仓储实现
/// </summary>
public class RedisRepository<TEntity> :
IDisposable,
IRepository<TEntity>
where TEntity : RedisEntity
{
IRedisClient redisDB;
IRedisTypedClient<TEntity> redisTypedClient;
IRedisList<TEntity> table;
public RedisRepository()
{
redisDB = RedisManager.GetClient();
redisTypedClient = redisDB.GetTypedClient<TEntity>();
table = redisTypedClient.Lists[typeof(TEntity).Name];
} #region IRepository<TEntity>成员
public void SetDbContext(IUnitOfWork unitOfWork)
{
throw new NotImplementedException();
} public void Insert(TEntity item)
{
if (item != null)
{
redisTypedClient.AddItemToList(table, item);
redisDB.Save();
}
} public void Delete(TEntity item)
{
if (item != null)
{
var entity = Find(item.RootID);
redisTypedClient.RemoveItemFromList(table, entity);
redisDB.Save();
}
} public void Update(TEntity item)
{
if (item != null)
{
var old = Find(item.RootID);
if (old != null)
{
redisTypedClient.RemoveItemFromList(table, old);
redisTypedClient.AddItemToList(table, item);
redisDB.Save();
}
}
} public IQueryable<TEntity> GetModel()
{
return table.GetAll().AsQueryable();
} public TEntity Find(params object[] id)
{
return table.Where(i => i.RootID == (string)id[]).FirstOrDefault();
}
#endregion #region IDisposable成员
public void Dispose()
{
this.ExplicitDispose();
}
#endregion #region Protected Methods /// <summary>
/// Provides the facility that disposes the object in an explicit manner,
/// preventing the Finalizer from being called after the object has been
/// disposed explicitly.
/// </summary>
protected void ExplicitDispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
} protected void Dispose(bool disposing)
{
if (disposing)//清除非托管资源
{
table = null;
redisTypedClient = null;
redisDB.Dispose();
}
}
#endregion #region Finalization Constructs
/// <summary>
/// Finalizes the object.
/// </summary>
~RedisRepository()
{
this.Dispose(false);
}
#endregion
}
}
下面是在控制台中进行仓储的调用
IRepository<Car> repository = new Redis.Data.Core.RedisRepository<Car>();
repository.Insert(new Car { ID = , Name = "占" });
var entity = repository.GetModel().Where(i => i.ID == ).FirstOrDefault();
entity.Name = "修改了";
repository.Update(entity);
repository.GetModel().ToList().ForEach(e =>
{
Console.WriteLine(e.ID + "/" + e.RootID + "/" + e.Name);
});
下面是实现的结果的截图
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAa8AAACHCAIAAAAugUG5AAAW70lEQVR4nO1b679dVXU9nyu2gmAVWgvykGcSXgGBPHiJkgABgkoiJASEBELehCCQBMIjIRAgPAVrFQWEVrE8q1jZgFU+9kP/oH44l+POnmuONeZa+yQ3947xW7/722euucYYc655Nxc5Dv7uuNuL1xeOv/0Lx98xXIeccMchJ6w+5ITVh3xz9Rcn1p1fPPHOvx+uk9b8w2idvPZLw3XK2i+dsvbQU9Ydesq6Q09dd+ip6w47df1hp60/7LT1Xx6uGRu+PGPD4TM2HD5zw+EzNx4+c+MRMzceMWvjEbM2HTFr01dmbfrK6cN11z+eMbG+esbmr545sb521uavnXX3cB159t1Hnr3lyLO3HDl7y1Gztxw1+56jZt/zT+d8vs798T+P1rfu/fp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5/mAb/zbq9VfxG06tQEIRJBPyHIXhhNalvCPF/8U2jV2G0L15mwR/VzD/TkheZ9V9w5UlLZL1MnJTmHdrkkC7jn+lDVDrUnyYFLBe6l1DHgB+mrpCQx5D82X7IHuwESdFpAXudIBOkJYeMl87yeD6Z5yiYWnr3gH+RsrplciHOLH+lf4Yze7zgXor71v5IGuOF2geBlieXJOmkRZs/vQCKL5hC3EcvoXjayBwGzLR5WmUemhZ4bzX18v55iRr/JGf2eMG9hFrnncXGWtfLCln+zs+sKOAZBbPqIbdTCl5DkxPQud3OWNitshG0tKTP4snzrNp4tpayGpO6Sc6aer1+2oY3qXsM9YfR9epNHge62bqwbrGfLH9BvXar2fdqOvGkDdsfewpUhxOmJsCtJK/Edr/9kIwnn0PTAPKT85HMb1IAPvFWMpI1z+hm/XRKi9Y7cPrZNsZYwgm8bnFLsbQ9Dkpm6sr6SRbLP+MmNK2rwd46acmgd5BPmMrwBgikdabHDhMzScw0WCHGP46TfsitqGI7swOGgTeJj3f6CWwkn/vSHZhW4HqzfnrhCflJxi2P7VuWpB1v/+wIJZMxCQaTM2WRvEic5g1f9taTyUAa55fFSX5vq0Yu6iGrEjoL8r179J771fV4ksxlfjB5kgdXUbZVzDD6aeNMEJDwDFMW/ETiI5387HRiLXJki/nJosh6a3QZDzX9qdTKpo1Dl6m3zM9YeUAcCGW1Ogyjn8mzNjm7BUCmTSk0LbSDILl9KsnjxbO6HRUmv4AflNbs+8vg1dsY4DivnqTyfPZSL+hbY35L7ZF2hFFn6kpK2GTsh+lbAY9XppfssSX5cfdGVq2HpJ+k1TYJBpMjCIJwAJB8PXmvYO+VjdmycoIgCAce3h+2TDIZacf1NhQEYZKi82/ZZWcr44IgCIIgCIIgCIIgTBP8PxCgzyvWhVMGAAAAAElFTkSuQmCC" alt="" />
Redis学习笔记~是时候为Redis实现一个仓储了,RedisRepository来了的更多相关文章
-
Redis学习笔记(2)——Redis的下载安装部署
一.下载Redis Redis的官网下载页上有各种各样的版本,如图 但是官网下载的Redis项目不正式支持Windows.如果需要再windows系统上部署,要去GitHub上下载.我下载的是Redi ...
-
Redis学习笔记(3)——Redis的命令大全
Redis是一种nosql数据库,常被称作数据结构服务器,因为值(value)可以是 字符串(String), 哈希(Map), 列表(list), 集合(sets) 和 有序集合(sorted se ...
-
Redis学习笔记(1)——Redis简介
一.Redis是什么? Remote Dictionary Server(Redis) 是一个开源的使用ANSI C语言编写.遵守BSD协议.支持网络.可基于内存亦可持久化的日志型.Key-Value ...
-
Redis学习笔记(三)Redis支持的5种数据类型的总结
继续Redis学习笔记(二)来说说剩余的三种数据类型. 三.列表类型(List) 1.介绍 列表类型可以存储一个有序的字符串列表,常用的操作是向列表两端添加元素,或者获得列表的一段片段.列表类型内部是 ...
-
Redis学习笔记(二)Redis支持的5种数据类型的总结之String和Hash
引言 在Redis学习笔记(一)中我们已经会安装并且简单使用Redis了,接下来我们一起来学习下Redis支持的5大数据类型. 简介 Redis是REmote DIctionary Server(远程 ...
-
Redis学习笔记(二) Redis 数据类型
Redis 支持五种数据类型:string(字符串).list(列表).hash(哈希).set(集合)和 zset(有序集合),接下来我们讲解分别讲解一下这五种类型的的使用. String(字符串) ...
-
Redis 学习笔记系列文章之 Redis 的安装与配置 (一)
1. 介绍 Redis is an open source (BSD licensed), in-memory data structure store, used as database, cach ...
-
Redis学习笔记之一 : 配置redis
Redis 简介 Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. Redis 与其他 key - value 缓存产品有以下三个特点: Redis支持数据的持久 ...
-
Redis学习笔记(5)——Redis数据持久化
出处http://www.cnblogs.com/xiaoxi/p/7065328.html 一.概述 Redis的强大性能很大程度上都是因为所有数据都是存储在内存中的,然而当Redis重启后,所有存 ...
随机推荐
-
庆祝下:iOS 开发者企业级计划(299美元/年帐户+邓白氏码免费) 和 Windows Phone公司应用(公司帐户99美元+Symantec企业证书299美元/年))顺利发布成功
时间:2013-11-15,地址:http://192.168.0.8 网站可下载三个终端应用直接安装IOS,Windows Phone,Android iOS: 企业版IDP通过 iTunes.使 ...
-
http://crunchify.com/simplest-spring-mvc-hello-world-example-tutorial-spring-model-view-controller-tips/ 非常棒的spring入门,maven,以及eclipse
http://crunchify.com/simplest-spring-mvc-hello-world-example-tutorial-spring-model-view-controller-t ...
-
css文件和js文件后面带一个问号
经常看一些网站页面源代码中的css文件和js文件后面带一个问号,后面跟着一连串数字或字符,这是干什么用的? 这个方法我也用过,而且很好用?,它的作用有两个:1.作为版本号,让自己方便记忆.查找:2.作 ...
-
虚继承之单继承的内存布局(VC在编译时会把vfptr放到类的头部,这和Delphi完全一致)
C++2.0以后全面支持虚函数与虚继承,这两个特性的引入为C++增强了不少功能,也引入了不少烦恼.虚函数与虚继承有哪些特性,今天就不记录了,如果能搞了解一下编译器是如何实现虚函数和虚继承,它们在类的内 ...
-
__x__(37)0909第五天__背景图按钮
link,hover,active三种按键状态,存放三张图片 缺点: 资源只有在被使用时,才会被加载. 页面第一次加载时,会出现短暂的延迟闪烁,造成一次不佳的用户体验. 图片整合技术 CSS-Spri ...
-
monodepth 训练记录
2019年2月22日13:52:37 https://zhuanlan.zhihu.com/p/29968267 这里有个tensorlfow代码的阅读博客: https://zhuanlan.zhi ...
-
读C#开发实战1200例子记录-2017年8月14日11:20:38获取汉字编码值
try { char chr = textBox1.Text[0]; byte[] gb2312_bt = Encoding.GetEncoding("gb2312").GetBy ...
-
禅道迁移(windows_to_linux)
需求分析 随着禅道数据的增加,原来通过虚拟机提供的mysql服务器相应速度跟不上需求.且原来禅道的前端与数据库分离安装在windows与linux中,现在提供实体服务器,需要将禅道环境迁移. 确认环境 ...
-
n层满k叉树总共有多少个节点
2叉树 1 3 7 对应公式为(2^n-1)/1 3叉树 1 4 13 对应公式为(3^n-1)/2 4叉树 1 5 21对应公式为(4^n-1)/3 ... n层k叉树,总共有(k^n-1)/k-1 ...
-
MQTT介绍(1)简单介绍
MQTT目录: MQTT简单介绍 window安装MQTT服务器和client java模拟MQTT的发布,订阅 MQTT: MQTT(Message Queuing Telemetry Transp ...