예제 #1
0
        public static bool TryParseAndValidate(string value, out TableEntityPath path)
        {
            if (value == null)
            {
                path = null;
                return(false);
            }

            string[] components = value.Split(new char[] { '/' });
            if (components.Length != 3)
            {
                path = null;
                return(false);
            }

            string tableName    = components[0];
            string partitionKey = components[1];
            string rowKey       = components[2];

            if (!TableClient.IsValidAzureTableName(tableName))
            {
                path = null;
                return(false);
            }

            if (!TableClient.IsValidAzureTableKeyValue(partitionKey))
            {
                path = null;
                return(false);
            }

            if (!TableClient.IsValidAzureTableKeyValue(rowKey))
            {
                path = null;
                return(false);
            }

            path = new TableEntityPath(tableName, partitionKey, rowKey);
            return(true);
        }