示例#1
0
        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");
        }
示例#2
0
 // Tweet Factory
 public static async Task <ITweet> GetTweet(long tweetId)
 {
     return(await Sync.ExecuteTaskAsync(() => Tweet.GetTweet(tweetId)));
 }