String to request dto?

is there a built-in method to convert a string name of a request to a requestdto object?
trying something out of the box want to pass a string to a console app that has an app host and id like to send the request using gateway send( the request object)

A lot of the Service introspection APIs can be found in AppHost.Metadata, here’s an example showing how you can create a Request DTO and invoke an API with object dictionary args:

// Create Request DTO
var requestType = appHost.Metadata.GetOperationType(requestName);
var requestArgs = new Dictionary<string, object> { ... };
var requestDto = appHost.Metadata.CreateRequestDto(requestType, requestArgs);

// Resolve Response Type of API
var responseType = appHost.Metadata.GetResponseTypeByRequest(requestType);

// Send with Service Gateway
var gateway = appHost.GetServiceGateway();
var response = gateway.Send(responseType, requestDto);
1 Like