Skip to content

Commit 254e986

Browse files
Add SaveRemoteAsync to save and wait on a sync to complete
1 parent a192b2d commit 254e986

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

NomadCode.Azure/NomadCode.Azure/AzureClient/AzureClient_CRUD.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ public async Task SyncAsync<T> ()
2222
await syncAsync (getTable<T> ());
2323
}
2424

25+
26+
/// <summary>
27+
/// Inserts or updates the items and waits to return until after a sync has finished.
28+
/// </summary>
29+
/// <param name="item">Item.</param>
30+
/// <typeparam name="T">The Table to save to.</typeparam>
31+
public async Task SaveRemoteAsync<T> (T item)
32+
where T : AzureEntity, new()
33+
{
34+
var table = getTable<T> ();
35+
36+
await insertOrUpdateAsync (table, item, null, false);
37+
38+
await syncAsync (table);
39+
}
40+
2541
#endif
2642

2743
/// <summary>

0 commit comments

Comments
 (0)