Hi am using the latest released version (0.9.2.3) to reply to an existing tweet via PublishInReplyTo method but i get the exception below. I found something similar in the issues.
https://tweetinvi.codeplex.com/workitem/2152
I guess you fixed GetPublishTweetQuery method but not GetPublishTweetInReplyToQuery. Can you check this.
System.ArgumentNullException was caught
HResult=-2147467261
Message=Value cannot be null.
Parameter name: source
Source=System.Core
ParamName=source
StackTrace:
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
at Tweetinvi.Controllers.Tweet.TweetQueryGenerator.GetPublishTweetInReplyToQuery(ITweetDTO tweetToPublish, Int64 tweetIdToReplyTo)
at Tweetinvi.Controllers.Tweet.TweetQueryExecutor.PublishTweetInReplyTo(ITweetDTO tweetToPublish, Int64 tweetIdToReplyTo)
at Tweetinvi.Controllers.Tweet.TweetController.PublishTweetInReplyTo(ITweet tweetToPublish, Int64 tweetIdToReplyTo)
at Tweetinvi.Logic.Tweet.PublishInReplyTo(Int64 replyToTweetId)
```
public string GetPublishTweetQuery(ITweetDTO tweetDTO)
{
if (!_tweetQueryValidator.CanTweetDTOBePublished(tweetDTO))
{
return null;
}
string baseQuery = String.Format(Resources.Tweet_Publish, CleanupString(tweetDTO.Text));
__if (tweetDTO.MediasToPublish != null && tweetDTO.MediasToPublish.Any())__
{
baseQuery = String.Format(Resources.Tweet_PublishWithMedia, CleanupString(tweetDTO.Text));
}
return AddAdditionalParameters(tweetDTO, baseQuery);
}
public string GetPublishTweetInReplyToQuery(ITweetDTO tweetToPublish, long tweetIdToReplyTo)
{
if (!_tweetQueryValidator.CanTweetDTOBePublished(tweetToPublish))
{
return null;
}
string baseQuery = String.Format(Resources.Tweet_PublishInReplyTo, CleanupString(tweetToPublish.Text), tweetIdToReplyTo);
__if (tweetToPublish.MediasToPublish.Any())__
{
baseQuery = String.Format(Resources.Tweet_PublishWithMediaInReplyTo, CleanupString(tweetToPublish.Text), tweetIdToReplyTo);
}
return AddAdditionalParameters(tweetToPublish, baseQuery);
}
```
Comments: ** Comment from web user: linvi **
https://tweetinvi.codeplex.com/workitem/2152
I guess you fixed GetPublishTweetQuery method but not GetPublishTweetInReplyToQuery. Can you check this.
System.ArgumentNullException was caught
HResult=-2147467261
Message=Value cannot be null.
Parameter name: source
Source=System.Core
ParamName=source
StackTrace:
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
at Tweetinvi.Controllers.Tweet.TweetQueryGenerator.GetPublishTweetInReplyToQuery(ITweetDTO tweetToPublish, Int64 tweetIdToReplyTo)
at Tweetinvi.Controllers.Tweet.TweetQueryExecutor.PublishTweetInReplyTo(ITweetDTO tweetToPublish, Int64 tweetIdToReplyTo)
at Tweetinvi.Controllers.Tweet.TweetController.PublishTweetInReplyTo(ITweet tweetToPublish, Int64 tweetIdToReplyTo)
at Tweetinvi.Logic.Tweet.PublishInReplyTo(Int64 replyToTweetId)
```
public string GetPublishTweetQuery(ITweetDTO tweetDTO)
{
if (!_tweetQueryValidator.CanTweetDTOBePublished(tweetDTO))
{
return null;
}
string baseQuery = String.Format(Resources.Tweet_Publish, CleanupString(tweetDTO.Text));
__if (tweetDTO.MediasToPublish != null && tweetDTO.MediasToPublish.Any())__
{
baseQuery = String.Format(Resources.Tweet_PublishWithMedia, CleanupString(tweetDTO.Text));
}
return AddAdditionalParameters(tweetDTO, baseQuery);
}
public string GetPublishTweetInReplyToQuery(ITweetDTO tweetToPublish, long tweetIdToReplyTo)
{
if (!_tweetQueryValidator.CanTweetDTOBePublished(tweetToPublish))
{
return null;
}
string baseQuery = String.Format(Resources.Tweet_PublishInReplyTo, CleanupString(tweetToPublish.Text), tweetIdToReplyTo);
__if (tweetToPublish.MediasToPublish.Any())__
{
baseQuery = String.Format(Resources.Tweet_PublishWithMediaInReplyTo, CleanupString(tweetToPublish.Text), tweetIdToReplyTo);
}
return AddAdditionalParameters(tweetToPublish, baseQuery);
}
```
Comments: ** Comment from web user: linvi **
Thank you for reporting the problem.
I will have a look into it.
Linvi