I am using the linqtotwitter function below to get statuses by ID and it works as expected. But I was wondering if there was a way to only call this function once(by passing the collection of id's to the query and the function would return a collection). Because the way I am currently getting statuses by looping through the collection of Id's and call GetTweetByKey
each time.
C#:
public async Task<Status> GetTweetByKey(string key, StatusType statusType)
{
try
{
return await (
from tweet in _twitterContext.Status
where tweet.Type == statusType &&
tweet.ID == Convert.ToUInt64(key) &&
tweet.TweetMode == TweetMode.Extended &&
tweet.IncludeEntities == true
select tweet).FirstOrDefaultAsync();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return null;
}
}