示例#1
0
		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;
		}
示例#2
0
		public static async Task InsertScoreAsync (UserScore score)
		{
			await scoreTable.InsertAsync (score);
		}
示例#3
0
		public static async Task UpdateScoreAsync (UserScore score)
		{
			await scoreTable.UpdateAsync (score);
		}