0

I am trying to call a REST service on Salesforce. I found a great example with C#, and I am attempting to translate it to VB.Net. So far I did well translating, but one line is giving me trouble.

Please help with the translation of this line of code:

Task<QueryResult<dynamic>> results = client.QueryAsync<dynamic>("Select Id, FirstName, LastName from Contact");

Basically, the result of the REST call is returned using a dynamic keyword that is supposed to create the result type. In VB.Net, when no type is provided, it should be the equivalent to a dynamic type in C#.

I tried :

 Dim o_results = o_client.QueryAsync("select Id, FirstName, LastName, email from contact")

But I get the error:

BC32050 Type parameter 'T' for 'Public Overloads Function QueryAsync(Of T)(query As String) As Task(Of QueryResult(Of T))' cannot be inferred.

Philippe
  • 548
  • 8
  • 24

0 Answers0