For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
5 2 2 6

using dynamic class resulting cannot convert from .InstrumentIdentifierList to SubjectIdentifierList

I'm using reflection to use the list of objects of extrationrequest but having issue setting the instrument list when using dynamic class.

for example - using the code

dynamic obj = new CommoditiesCorrectionsHistoryExtractionRequest();

this will work good

extractionRequest.IdentifierList = InstrumentIdentifierList.Create(

new[]

{

new InstrumentIdentifier { Identifier = "191216100", IdentifierType = IdentifierType.Cusip,UserDefinedIdentifier = "AA" }

}, null, false);


this way, error was raised

Type[] typelist = GetTypesInNamespace(myAssembly, "ThomsonReuters.Dss.Api.Extractions.ExtractionRequests");

Type tt = typelist[0] //CommoditiesCorrectionsHistoryExtractionRequest

dynamic obj = Activator.CreateInstance(tt);

error will be raised

extractionRequest.IdentifierList = InstrumentIdentifierList.Create(

new[]

{

new InstrumentIdentifier { Identifier = "191216100", IdentifierType = IdentifierType.Cusip,UserDefinedIdentifier = "AA" }

}, null, false);

dss-rest-apidatascope-selectdss
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.

1 Answer

· Write an Answer
Upvotes
Accepted
5 2 2 6

the issue was resolved by getting the correct assembly execution path -

Assembly.GetExecutingAssembly().Location

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.