public async Task Save(LastTweet lastTweet) { CloudTable table = GetTable(); // Create the InsertOrReplace TableOperation. TableOperation insertOrReplaceOperation = TableOperation.InsertOrReplace(lastTweet); // Execute the operation. await table.ExecuteAsync(insertOrReplaceOperation); }
public LastTweet GetLastTweet() { var table = GetTable(); TableQuery<LastTweet> query = new TableQuery<LastTweet>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "1")); LastTweet lastTweet = table.ExecuteQuery(query).FirstOrDefault(); if (lastTweet == null) { lastTweet = new LastTweet(649474600812834816); } return lastTweet; }