Get() public méthode

Retrieve a value by key from the table. Returns null if not found.
public Get ( byte key ) : byte[]
key byte The key to look for.
Résultat byte[]
Exemple #1
0
        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);
        }