public string DeleteTweet(long id) { var success = Auth.ExecuteOperationWithCredentials(_credentialService.GetUserCredentials(), () => { ITweet toDelete = Tweet.GetTweet(id); try { toDelete.Destroy(); return(true); } catch (Exception) { return(false); } }); return(success ? "deleted" : "failed to delete"); }
// Tweet Factory public static async Task <ITweet> GetTweet(long tweetId) { return(await Sync.ExecuteTaskAsync(() => Tweet.GetTweet(tweetId))); }