void startTimeAdded(DataStore.Result <List <DateTime> > result) { if (result.Success) { // If the store was successful we are done Log.Write($"Start time list has {result.Object.Count} entries"); } else { if (result.Object != null) { // another script modified the key since it was restored // the new version should is here addStartTime(result.Object, result.Version); } else { // if the object is null, some other error occurred // the message will have a short description // the JsonString may have data, if any was returned from the database Log.Write($"Unexpected error: {result.Message}"); Log.Write($"Response body:{result.JsonString}"); } } }
void getStartTime(DataStore.Result <List <DateTime> > result) { List <DateTime> startTimes = null; int version = 0; if (result.Success) { startTimes = result.Object; version = result.Version; } else { //if the lookup failed, then this script is the first, so create a new list startTimes = new List <DateTime>(); } addStartTime(startTimes, version); }