Share via


TableClient.UpdateEntity<T> Method

Definition

Updates the specified table entity of type T, if it exists. If the mode is Replace, the entity will be replaced. If the mode is Merge, the property values present in the entity will be merged with the existing entity.

public virtual Azure.Response UpdateEntity<T> (T entity, Azure.ETag ifMatch, Azure.Data.Tables.TableUpdateMode mode = Azure.Data.Tables.TableUpdateMode.Merge, System.Threading.CancellationToken cancellationToken = default) where T : Azure.Data.Tables.ITableEntity;
abstract member UpdateEntity : 'T * Azure.ETag * Azure.Data.Tables.TableUpdateMode * System.Threading.CancellationToken -> Azure.Response (requires 'T :> Azure.Data.Tables.ITableEntity)
override this.UpdateEntity : 'T * Azure.ETag * Azure.Data.Tables.TableUpdateMode * System.Threading.CancellationToken -> Azure.Response (requires 'T :> Azure.Data.Tables.ITableEntity)
Public Overridable Function UpdateEntity(Of T As ITableEntity) (entity As T, ifMatch As ETag, Optional mode As TableUpdateMode = Azure.Data.Tables.TableUpdateMode.Merge, Optional cancellationToken As CancellationToken = Nothing) As Response

Type Parameters

T

A custom model type that implements ITableEntity or an instance of TableEntity.

Parameters

entity
T

The entity to update.

ifMatch
ETag

The If-Match value to be used for optimistic concurrency. If All is specified, the operation will be executed unconditionally. If the ETag value is specified, the operation will fail with a status of 412 (Precondition Failed) if the ETag value of the entity in the table does not match.

mode
TableUpdateMode

Determines the behavior of the Update operation.

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

The Response indicating the result of the operation.

Exceptions

The server returned an error. See Message for details returned from the server.

Remarks

See TableUpdateMode for more information about the behavior of the mode.

Applies to