async public Task <Challenge> PostChallenge() { Challenge.ProposedTime = SelectedDateTime.ToUniversalTime(); var success = await AzureService.Instance.ChallengeManager.InsertAsync(Challenge); Challenge.League.LocalRefresh(); if (success) { MessagingCenter.Send(App.Instance, Messages.ChallengesUpdated); return(Challenge); } return(null); }
async public Task <Challenge> PostChallenge() { Challenge.ProposedTime = SelectedDateTime.ToUniversalTime(); var task = AzureService.Instance.SaveChallenge(Challenge); await RunSafe(task); if (task.IsFaulted) { return(null); } Challenge.League.RefreshChallenges(); MessagingCenter.Send <App>(App.Current, Messages.ChallengesUpdated); return(Challenge); }