public static async Task PublishScore (int score) { UserScore userscore = await AzureDB.GetUserScoreAsync (); if (userscore == null) await AzureDB.InsertScoreAsync (new UserScore () { UserName = UserAccount.Id, Score = score }); else if (userscore.Score < score) { var entry = new UserScore () { Id = userscore.Id, UserName = UserAccount.Id, Score = score }; await AzureDB.UpdateScoreAsync (entry); } else UserAccount.Score = userscore.Score; }
public static async Task InsertScoreAsync (UserScore score) { await scoreTable.InsertAsync (score); }
public static async Task UpdateScoreAsync (UserScore score) { await scoreTable.UpdateAsync (score); }