• Configuration
    • app.config
      <configSections>
          <section name="redisClientSection" type="Beetle.Redis.RedisClientSection, Beetle.Redis"/>
        </configSections>
        <connectionStrings>
        <redisClientSection dB="0" cached="" xmlns="urn:Beetle.Redis">
          <writes>
            <add host="192.168.0.108" connections="10"/>
          </writes>
          <reads>
            <add host="192.168.0.108" connections="10"/>
          </reads>
        </redisClientSection>
      
    • default db
      RedisClient.DefaultDB
      
    • create db
      Beetle.Redis.RedisClient db = new Redis.RedisClient("redisClientSection");
      
    • use default db
      RedisKey rk = "henry_protobuf".RedisProtobuf();
      rk.Get<UserBase>()
      
    • or
      Beetle.Redis.RedisClient db = new Redis.RedisClient("redisClientSection");
      RedisKey rk = "henry_protobuf".RedisProtobuf();
      rk.Get<UserBase>(db)
      
  • FormatType
    • string
      RedisKey rk = "beetle".RedisString();
      
    • json
      RedisKey rk = "beetle".RedisJson();
      
    • protobuf
      RedisKey rk = "beetle".RedisProtobuf();
      
  • Get 
    • object
      RedisKey rk = "cust_ALFKI".RedisProtobuf(); Customer customer = rk.Get<Customer>();
      
    • multi- object
      RedisKey rk = new string[]{ "emp_1","cust_ALFKI"}.RedisProtobuf(); 
      IList<object> result = rk.Get<Employee, Customer>();
      
  • Set
  • Field
  • List
  • Keys
          IList<string> keys = "*".RedisJson().Keys();
          keys = "henry*".RedisJson().Keys();
    
  • Del
         "cust_ALFKI".RedisString().Delete();
         new string[]{"emp_1","cust_ALFKI"}.RedisString().Delete();

Last edited Aug 17, 2013 at 8:53 AM by smarkhenry, version 16

Comments

No comments yet.