|
|
@ -30,7 +30,7 @@ namespace RedisStudyTest
|
|
|
|
private Student defaultStudent = null;
|
|
|
|
private Student defaultStudent = null;
|
|
|
|
private string preStudentHashKey = "RedisStudy:Student:";
|
|
|
|
private string preStudentHashKey = "RedisStudy:Student:";
|
|
|
|
private string defaultStudentHashKey = "";
|
|
|
|
private string defaultStudentHashKey = "";
|
|
|
|
private int keyDefaultExpireSeconds = 20;
|
|
|
|
private int defaultExpireSeconds = 20;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 构造
|
|
|
|
/// 构造
|
|
|
@ -159,7 +159,7 @@ namespace RedisStudyTest
|
|
|
|
Assert.True(addHash);
|
|
|
|
Assert.True(addHash);
|
|
|
|
|
|
|
|
|
|
|
|
//设置过期
|
|
|
|
//设置过期
|
|
|
|
redisDatabase.KeyExpire(defaultStudentHashKey, TimeSpan.FromSeconds(keyDefaultExpireSeconds));
|
|
|
|
redisDatabase.KeyExpire(defaultStudentHashKey, TimeSpan.FromSeconds(defaultExpireSeconds));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
@ -184,7 +184,7 @@ namespace RedisStudyTest
|
|
|
|
Assert.True(addStudent);
|
|
|
|
Assert.True(addStudent);
|
|
|
|
|
|
|
|
|
|
|
|
//设置过期
|
|
|
|
//设置过期
|
|
|
|
redisDatabase.KeyExpire(redisKey, TimeSpan.FromSeconds(keyDefaultExpireSeconds));
|
|
|
|
redisDatabase.KeyExpire(redisKey, TimeSpan.FromSeconds(defaultExpireSeconds));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//清理删除
|
|
|
|
//清理删除
|
|
|
|