Redis内存ocupation Store和AddToRecentsList

时间:2015-05-06 17:55:36

标签: c# redis

我是Redis的新手,非常感谢你能帮助解决这个问题。

我有一个简单的课程

    public class Person
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Surname { get; set; }
    public int Age { get; set; }
    public string Profession { get; set; }
}

以下

     public void StorePerson( Person Item)
 {
 using (var redisClient = redisManager.GetClient())
            {
                var redisPerson = redisClient.As<Person>();
                redisPerson.Store(item);
                IRedisList<Person> ListOfPeople = redis.Lists["urn:people"];
                ListOfPeople.AddToRecentsList(item);


            }
    }

这段代码会在两个地方或一个地方存储相同的人物(列表只是指向人物的指针)吗?

1 个答案:

答案 0 :(得分:0)

我不确定您使用哪个库来访问Redis。 Redis是一个字符串键值存储,因此不会保留任何引用(使用的API可以某种方式实现它)。对于KEYS和LIST使用不同的命令,非常好的描述在此Data type tutorial