Redis Set操作

 

     public void CleanPur()
        {
            var typedClient = _redisClient.As<PurClass>();
            typedClient.DeleteAll();
        }

        public void RemovePur(string u_dataid,string u_purno)
        {
            var typedClient = _redisClient.As<PurClass>();
            typedClient.Delete(typedClient.GetAll().Where(p => p.u_dataid == u_dataid)
                .Where(p => p.u_purno == u_purno).First());
        }

        public void StorePur(PurClass customer)
        {
            var typedClient = _redisClient.As<PurClass>();
            typedClient.Store(customer);
        }

        public IList<PurClass> AllPur()
        {
            var typedClient = _redisClient.As<PurClass>();
            return typedClient.GetAll();
        }

        public IList<PurClass> Pur(string u_dataid,string u_purno)
        {
            var typedClient = _redisClient.As<PurClass>();
            return typedClient.GetAll().Where(p => p.u_dataid == u_dataid)
                .Where(p => p.u_purno.StartsWith(u_purno.Substring(0, 4))).ToList(); 
        }

 

posted @ 2015-08-28 14:22  欣欣点灯  阅读(237)  评论(0编辑  收藏  举报