Moved Remove operation to start of Table.Apply #2967
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
Intends to resolve issue 343 of the C# SDK.
In issue 343, the example project uses fails due the
PlayerFruitState
table being defined with anIdentity
value is marked asunique
rather thanprimary_key
as is typically the case. Without defining aprimary key
, data from all rows is used as the primary key.In the sample project, when the
PlayerFruitState
table was being updated, theIdentity
value would stay the same, and the other values would change. This should still be a supported operation, and would look like a removal of the Identity row with the old value and an addition of the Identity row with the new value, rather than a single update operation.Note: If the
Identity
was marked asprimary_key
, this would be an update operation, because only theIdentity
value would be used for the key, rather than all rows.Because of the existing order of operations in a
Table.cs
'sApply
method, the new row being added to thePlayerFruitState
table prior to the old row being removed. Due to theIdentity
value having theunique
constraint, this caused the initial add to throw an error during the add operation.This change simply moves the Remove operation before Add, which is best-practice for these types of operations.
API and ABI breaking changes
Not API breaking.
Expected complexity level and risk
1
Testing