defval
public virtual byte[] Get(byte[] key, byte[] defval) { byte[] value = client.Get(tableID, key); if (value != null) return value; else return defval; }
public bool IsConsistent() { TestUser user; TestUserInfo cmpinfo; byte[] row; // byte array? foreach (string key in table.GetKeyIterator(new StringRangeParams())) { user = GetUser(key); row = tableByNick.Get(System.Text.Encoding.UTF8.GetBytes(user.info.Nick + "|" + user.info.id.ToString())); if (row == null) { return(false); } cmpinfo = Utils.JsonDeserialize <TestUserInfo>(row); if (user.info != cmpinfo) { return(false); } row = tableByBirth.Get(System.Text.Encoding.UTF8.GetBytes(user.info.DateOfBirth + "|" + user.info.id.ToString())); if (row == null) { return(false); } cmpinfo = Utils.JsonDeserialize <TestUserInfo>(row); if (user.info != cmpinfo) { return(false); } row = tableByLastLogin.Get(System.Text.Encoding.UTF8.GetBytes(user.info.LastLogin + "|" + user.info.id.ToString())); if (row == null) { return(false); } cmpinfo = Utils.JsonDeserialize <TestUserInfo>(row); if (user.info != cmpinfo) { return(false); } } return(true); }