Skip to content

Commit

Permalink
Update mode on table partition should set table repository mode
Browse files Browse the repository at this point in the history
By not setting the value in the underlying table, when setting the value via a property setter, we ended up not honoring it at all.
  • Loading branch information
kzu committed Jan 20, 2023
1 parent bf9ff04 commit a1abf09
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/TableStorage/TablePartition`1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ protected internal TablePartition(TableConnection tableStorage, string partition
/// <summary>
/// The <see cref="TableUpdateMode"/> to use when updating an existing entity.
/// </summary>
public TableUpdateMode UpdateMode { get; set; }
public TableUpdateMode UpdateMode
{
get => repository.UpdateMode;
set => repository.UpdateMode = value;
}

/// <summary>
/// The strategy to use when updating an existing entity.
Expand All @@ -61,8 +65,8 @@ protected internal TablePartition(TableConnection tableStorage, string partition
public UpdateStrategy UpdateStrategy
{
// Backs-compatible implementation
get => UpdateMode == TableUpdateMode.Replace ? UpdateStrategy.Replace : UpdateStrategy.Merge;
set => UpdateMode = value.UpdateMode;
get => repository.UpdateStrategy;
set => repository.UpdateStrategy = value;
}

/// <inheritdoc />
Expand Down

0 comments on commit a1abf09

Please sign in to comment.