C# Class Candor.WindowsAzure.Storage.Table.CloudTableRules

Helper methods to convert a string into valid table key values.
Show file Open project: michael-lang/candor-common

Public Methods

Method Description
GetValidPartitionKey ( this name ) : String

Gets a valid azure identifier for partition keys.

The following characters are not allowed in values for the PartitionKey and RowKey properties: The forward slash (/) character The backslash (\) character The number sign (#) character The question mark (?) character http://blogs.msdn.com/b/windowsazurestorage/archive/2012/05/28/partitionkey-or-rowkey-containing-the-percent-character-causes-some-windows-azure-tables-apis-to-fail.aspx Also the % character while allowed by Azure presents problems on retrieval due to double decoding by Azure.

GetValidRowKey ( this name ) : String

Gets a valid azure identifier for row keys.

The following characters are not allowed in values for the PartitionKey and RowKey properties: The forward slash (/) character The backslash (\) character The number sign (#) character The question mark (?) character http://blogs.msdn.com/b/windowsazurestorage/archive/2012/05/28/partitionkey-or-rowkey-containing-the-percent-character-causes-some-windows-azure-tables-apis-to-fail.aspx Also the % character while allowed by Azure presents problems on retrieval due to double decoding by Azure.

GetValidTableName ( this name ) : String

Gets a valid azure identifier for table names by trimming out invalid characters. If the name is still invalid, then an exception occurs. See remarks for naming rules.

Table names must be unique within an account. Table names may contain only alphanumeric characters. Table names cannot begin with a numeric character. Table names are case-insensitive. Table names must be from 3 to 63 characters long. Some table names are reserved, including "tables". Attempting to create a table with a reserved table name returns error code 404 (Bad Request). http://msdn.microsoft.com/en-us/library/windowsazure/dd179338.aspx These rules are also described by the regular expression "^[A-Za-z][A-Za-z0-9]{2,62}$". Table names preserve the case with which they were created, but are case-insensitive when used.

Method Details

GetValidPartitionKey() public static method

Gets a valid azure identifier for partition keys.
The following characters are not allowed in values for the PartitionKey and RowKey properties: The forward slash (/) character The backslash (\) character The number sign (#) character The question mark (?) character http://blogs.msdn.com/b/windowsazurestorage/archive/2012/05/28/partitionkey-or-rowkey-containing-the-percent-character-causes-some-windows-azure-tables-apis-to-fail.aspx Also the % character while allowed by Azure presents problems on retrieval due to double decoding by Azure.
public static GetValidPartitionKey ( this name ) : String
name this
return String

GetValidRowKey() public static method

Gets a valid azure identifier for row keys.
The following characters are not allowed in values for the PartitionKey and RowKey properties: The forward slash (/) character The backslash (\) character The number sign (#) character The question mark (?) character http://blogs.msdn.com/b/windowsazurestorage/archive/2012/05/28/partitionkey-or-rowkey-containing-the-percent-character-causes-some-windows-azure-tables-apis-to-fail.aspx Also the % character while allowed by Azure presents problems on retrieval due to double decoding by Azure.
public static GetValidRowKey ( this name ) : String
name this
return String

GetValidTableName() public static method

Gets a valid azure identifier for table names by trimming out invalid characters. If the name is still invalid, then an exception occurs. See remarks for naming rules.
Table names must be unique within an account. Table names may contain only alphanumeric characters. Table names cannot begin with a numeric character. Table names are case-insensitive. Table names must be from 3 to 63 characters long. Some table names are reserved, including "tables". Attempting to create a table with a reserved table name returns error code 404 (Bad Request). http://msdn.microsoft.com/en-us/library/windowsazure/dd179338.aspx These rules are also described by the regular expression "^[A-Za-z][A-Za-z0-9]{2,62}$". Table names preserve the case with which they were created, but are case-insensitive when used.
public static GetValidTableName ( this name ) : String
name this
return String