Amazon.CognitoSync.SyncManager.Internal.DatasetUtils.ValidateRecordKey C# (CSharp) Method

ValidateRecordKey() public static method

Validates the record key. It must be non empty and its length must be no greater than 128. Otherwise {@link IllegalArgumentException} will be thrown.
public static ValidateRecordKey ( string key ) : string
key string Key.
return string
        public static string ValidateRecordKey(string key)
        {
            if (string.IsNullOrEmpty(key) || Encoding.UTF8.GetByteCount(key) > 128)
            {
                throw new ArgumentException("Invalid record key");
            }
            return key;
        }