static async Task NewLongDirectMessageAsync(TwitterContext twitterCtx) { string messageOver140Characters = string.Join("-", Enumerable.Repeat("XXXX", 35)) + " - " + DateTime.Now; DirectMessage message = await twitterCtx.NewDirectMessageAsync("Linq2Twitr", messageOver140Characters); DirectMessage dmResponse = await (from dm in twitterCtx.DirectMessage where dm.Type == DirectMessageType.Show && dm.ID == message.IDResponse && dm.FullText == true // required for full text, otherwise text truncates to 140 select dm) .SingleOrDefaultAsync(); if (dmResponse != null && dmResponse.Recipient != null && dmResponse.Sender != null) { Console.WriteLine( "From: {0}\nTo: {1}\nMessage: {2}", dmResponse.Sender.Name, dmResponse.Recipient.Name, dmResponse.Text); } }
static async Task NewDirectMessageAsync(TwitterContext twitterCtx) { DirectMessage message = await twitterCtx.NewDirectMessageAsync( "Linq2Twitr", "Direct Message Test - " + DateTime.Now + "!'"); if (message != null) Console.WriteLine( "Recipient: {0}, Message: {1}, Date: {2}", message.RecipientScreenName, message.Text, message.CreatedAt); }