Dela via


TableAttribute Class

Definition

Attribute used to bind a parameter to an Azure Table or Table entity.

[Microsoft.Azure.WebJobs.ConnectionProvider(typeof(Microsoft.Azure.WebJobs.StorageAccountAttribute))]
[Microsoft.Azure.WebJobs.Description.Binding]
[System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue)]
public class TableAttribute : Attribute, Microsoft.Azure.WebJobs.IConnectionProvider
[<Microsoft.Azure.WebJobs.ConnectionProvider(typeof(Microsoft.Azure.WebJobs.StorageAccountAttribute))>]
[<Microsoft.Azure.WebJobs.Description.Binding>]
[<System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue)>]
type TableAttribute = class
    inherit Attribute
    interface IConnectionProvider
Public Class TableAttribute
Inherits Attribute
Implements IConnectionProvider
Inheritance
TableAttribute
Attributes
Microsoft.Azure.WebJobs.ConnectionProviderAttribute Microsoft.Azure.WebJobs.Description.BindingAttribute AttributeUsageAttribute
Implements
Microsoft.Azure.WebJobs.IConnectionProvider

Remarks

When only the table name is provided, the attribute binds to a table, and the method parameter type can be one of the following:

When the table name, partition key, and row key are provided, the attribute binds to a table entity, and the method parameter type can be one of the following:
  • ITableEntity
  • A user-defined type not implementing ITableEntity (serialized as strings for simple types and JSON for complex types)

Constructors

TableAttribute(String, String, String)

Initializes a new instance of the TableAttribute class.

TableAttribute(String, String)

Initializes a new instance of the TableAttribute class.

TableAttribute(String)

Initializes a new instance of the TableAttribute class.

Properties

Connection

Gets or sets the app setting name that contains the Azure Storage or Azure Cosmos connection string.

Filter

Gets or sets an OData table filter. RowKey should be null when setting this property. For example, to filter on a LastName and FirstName property within an entity, you might set the Filter as follows: Filter = "LastName%20eq%20'Smith'%20and%20FirstName%20eq%20'John'"

To learn more about constructing OData filter strings, see https://docs.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings.

PartitionKey

When binding to a table entity, gets the partition key of the entity.

RowKey

When binding to a table entity, gets the row key of the entity.

TableName

Gets the name of the table to which to bind.

Take

Gets or sets the number of elements to include when using the Filter property. RowKey should be null when setting this property.

Applies to