question

Upvotes
Accepted
68 3 7 10

GetAllInstruments

Hello everybody,

I saw here :

https://hosted.datascopeapi.reuters.com/RestApi.Help/Context/Operation?ctx=Extractions&ent=InstrumentList&opn=GetAllInstruments

that the method GetAllInstruments, of object InstrumentList, should allow to get the list of instruments associated with an InstrumentList.

So, I typed this code :

instrumentList = new InstrumentList { Name = strInstrumentListName };
List<InstrumentIdentifier> lii = instrumentList.GetAllInstruments();

But, I then obtained this exception at compile time :

Error    CS1061    'InstrumentList' does not contain a definition for 'GetAllInstruments' and no extension method 'GetAllInstruments' accepting a first argument of type 'InstrumentList' could be found (are you missing a using directive or an assembly reference?)

Where is the problem ? Does the documentation refer to another context ? Am I supposed to declare another reference ?

Or is it better to do it like this ?

var fromInstrumentList = 

extractionsContext.InstrumentListOperations.GetAllInstruments(listId);
tick-history-rest-apirics
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
32.2k 40 11 20

Hello @Hubert CANEVET,

In the usage as you describe first, your call is missing the argument, listId:

GetAllInstruments(string listId)

As per our example in .Net REST Example Application, please pass listId

 var instruments = extractionsContext.InstrumentListOperations.GetAllInstruments(instrumentList.ListId);

And if prior to this the list that is referenced has been created, and appended with instruments, this call should return all instruments.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
68 3 7 10

OK thank you, that is what I see in the example application.

Maybe the documentation can be seen a little ambiguous about that.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.