Presuming the right uses are in place and it’s on a 4.5 framework something like this should work:
var relationships :=
await
((from look in twitterCtx.Friendship
where (look.Type = FriendshipType.Lookup) and
(look.UserID = "15411837,16761255")
select look.Relationships)
.SingleOrDefaultAsync());
That’s odd. I just grabbed the 4.5 LinqTotwitterPCL.dll (from the page referenced above), copy/pasted this:
namespace ConsoleApplication89;
interface
uses
LinqToTwitter,
System.Linq;
type
ConsoleApp = class
public
class method Main(args: array of String);
end;
implementation
class method ConsoleApp.Main(args: array of String);
begin
var twitterCtx: TwitterContext;
var relationships :=
await
((from look in twitterCtx.Friendship
where (look.Type = FriendshipType.Lookup) and
(look.UserID = "15411837,16761255")
select look.Relationships)
.SingleOrDefaultAsync());
end;
end.
Oh, I see that it’s referring to the method that the code is contained in. The error shows in that method’s definition line in the usercontrol’s type declaration (which returns a boolean). I’m trying to figure out why it cares what the result of the method it’s wrapped in is.
Removing the async for the moment; one thing at a time. Any idea why I get the exception: “Requires ScreenName or UserID with a comma-separated list of twitter screen names or user IDs, respectively.” when userId is obviously there?
var relationships :=
(from look in twitterLinqCtx.Friendship
where (look.Type = FriendshipType.Lookup) and
(look.UserID = "15411837,16761255")
select look.Relationships)
.SingleOrDefault();
Which is C# syntax, right? I’m assuming since the dll was written in C# that this is correct, but I don’t see what is causing the error. Stumped here. This is the ONLY reason that I upgraded because I need to make this API call work as the toolset I was using before didn’t handle int64 user ID’s and is no longer being supported. Help!
Note: I cycled back to version 2 of linqToTwitter to get the async complications out of the problem but the error is the same.
It probably expects some exact thing C# does for this, even though this is actually correct. I can look into fixing it but do you have a working project that shows this so I can see it myself?
Yes, but it’s absolutely huge. I can make a smaller one that will generate the same error, but I need to email it to you because it will contain oauth keys.