src/TableAccess.cs
/// <summary>
/// Insert or Replace an entity.
/// </summary>
/// <param name="entity"> the entity to insert or replace. </param>
/// <returns>A task.</returns>
/// <exception cref="StorageException">Thrown if a non success code is returned from table storage insertion or update.</exception>
Insert or Replace an entity.
Insert or Replace an entity .
public virtual async Task InsertOrReplaceAsync(T entity)
        {
            if (entity == null)
            {
                this.logger?.LogWarning("Null value passed as insert or update parameter, returning early.");
                return;
            }
            await this.CreateIfNotExists();
            TableOperation insertOrReplaceOperation = TableOperation.InsertOrReplace(entity);
            TableResult result = await this.CloudTable.ExecuteAsync(insertOrReplaceOperation);
            if (result.HttpStatusCode >= 200 && result.HttpStatusCode < 300)
            {
                this.logger?.LogTrace($"Return code is {result.HttpStatusCode}");
            }
            else
            {
                string message = $"HttpStatusCode returned is {result.HttpStatusCode}";
                this.logger?.LogError(message);
                throw new StorageException(message);
            }
        }
public virtual async Task InsertOrReplaceAsync ( T entity ) { if ( entity == null ) { this . logger ? . LogWarning ( " " ) ; return ; } await this . CreateIfNotExists ( ) ; TableOperation insertOrReplaceOperation = TableOperation . InsertOrReplace ( entity ) ; TableResult result = await this . CloudTable . ExecuteAsync ( insertOrReplaceOperation ) ; if ( result . HttpStatusCode >= 200 && result . HttpStatusCode < 300 ) { this . logger ? . LogTrace ( $" Return code is  { result . HttpStatusCode } " ) ; } else { string message = $" HttpStatusCode returned is  { result . HttpStatusCode } " ; this . logger ? . LogError ( message ) ; throw new StorageException ( message ) ; } }
Insert or Replace an entity.
Insert or Replace an entity .
None
Thrown if a non success code is returned from table storage insertion or update.
Thrown if a non success code is returned from table storage insertion or update .
entity
T
the entity to insert or replace.
the entity to insert or replace .