Aug 9, 2010 at 3:56 AM


First - I signUp to twitter, then I try get DirectMessage, but when I try to run  twitterContext.DirectMessages.ToList() or .Count() throw the exception ArgumentException. But when I get status messages all ok. 

var messages = twitterContext.DirectMessage.ToList();


Sep 11, 2010 at 8:33 PM


In LinqToTwitter, entities have sub-types that are specified via a where clause, which means you can't materialize an entity directly, like you're trying to do.  If you look in the LinqToTwitterDemo project in the source code or in the Documentation on this site, you'll see many examples of the syntax.  Here's an example:

            var directMessages =
                (from tweet in twitterCtx.DirectMessage
                 where tweet.Type == DirectMessageType.SentTo &&
                       tweet.Count == 2
                 select tweet)