예제 #1
0
 protected override Task ProcessRecordAsync()
 {
     return(TwitterContext.CreateFavoriteAsync(Status.StatusID).ToObservable()
            .HandleErrors(this)
            .WriteObject(this)
            .ToTask());
 }
예제 #2
0
        static async Task CreateFavoriteAsync(TwitterContext twitterCtx)
        {
            var status = await twitterCtx.CreateFavoriteAsync(401033367283453953ul);

            if (status != null)
            {
                Console.WriteLine(
                    "User: {0}, Tweet: {1}", status.User.Name, status.Text);
            }
        }
        public async Task <IHttpActionResult> FavoriteTweet(string id)
        {
            ulong searchId       = UInt64.MinValue;
            bool  searchIdExists = ulong.TryParse(id, out searchId);

            if (!searchIdExists)
            {
                return(this.BadRequest());
            }

            var status = await twitCtx.CreateFavoriteAsync(searchId);

            return(this.Ok());
        }