Exemple #1
0
 private static void ValidateAttribute(TableAttribute attribute, Type parameterType)
 {
     // Queue pre-existing  behavior: if there are { }in the path, then defer validation until runtime.
     if (!attribute.TableName.Contains("{"))
     {
         TableClient.ValidateAzureTableName(attribute.TableName);
     }
 }
        public string Bind(IReadOnlyDictionary <string, object> bindingData)
        {
            IReadOnlyDictionary <string, string> parameters = BindingDataPathHelper.ConvertParameters(bindingData);
            string tableName = _template.Bind(parameters);

            TableClient.ValidateAzureTableName(tableName);

            return(tableName);
        }
Exemple #3
0
        public static IBindableTablePath Create(string tableNamePattern)
        {
            BindingTemplate template = BindingTemplate.FromString(tableNamePattern);

            if (template.ParameterNames.Count() > 0)
            {
                return(new ParameterizedTablePath(template));
            }

            TableClient.ValidateAzureTableName(tableNamePattern);
            return(new BoundTablePath(tableNamePattern));
        }
        public TableEntityPath Bind(IReadOnlyDictionary <string, object> bindingData)
        {
            string tableName    = _tableNameTemplate.Bind(bindingData);
            string partitionKey = _partitionKeyTemplate.Bind(bindingData);
            string rowKey       = _rowKeyTemplate.Bind(bindingData);

            TableClient.ValidateAzureTableName(tableName);
            TableClient.ValidateAzureTableKeyValue(partitionKey);
            TableClient.ValidateAzureTableKeyValue(rowKey);

            return(new TableEntityPath(tableName, partitionKey, rowKey));
        }
Exemple #5
0
        public static IBindableTableEntityPath Create(string tableNamePattern, string partitionKeyPattern,
                                                      string rowKeyPattern)
        {
            BindingTemplate tableNameTemplate    = BindingTemplate.FromString(tableNamePattern);
            BindingTemplate partitionKeyTemplate = BindingTemplate.FromString(partitionKeyPattern);
            BindingTemplate rowKeyTemplate       = BindingTemplate.FromString(rowKeyPattern);

            if (tableNameTemplate.HasParameters ||
                partitionKeyTemplate.HasParameters ||
                rowKeyTemplate.HasParameters)
            {
                return(new ParameterizedTableEntityPath(tableNameTemplate, partitionKeyTemplate, rowKeyTemplate));
            }

            TableClient.ValidateAzureTableName(tableNamePattern);
            TableClient.ValidateAzureTableKeyValue(partitionKeyPattern);
            TableClient.ValidateAzureTableKeyValue(rowKeyPattern);
            TableEntityPath innerPath = new TableEntityPath(tableNamePattern, partitionKeyPattern, rowKeyPattern);

            return(new BoundTableEntityPath(innerPath));
        }
Exemple #6
0
 public static string Validate(string value)
 {
     TableClient.ValidateAzureTableName(value);
     return(value);
 }