public async Task <object> Execute(ApiControllerRequestDto dto) { var method = _executionPipeline .GetType() .GetMethod("Execute") .MakeGenericMethod(dto.Request.GetType(), StaticHelpers.GetBusinessDtoType(dto.ResponseType)); return(await Task.Run( () => method.Invoke(_executionPipeline, new[] { (object)dto.Request, dto.AuthenticationToken }) )); }
public override void Execute() { var method = _connector .EndPoint .GetType() .GetMethod("Request") .MakeGenericMethod(Event.MetaData.Request.GetType(), StaticHelpers.GetBusinessDtoType(Event.MetaData.ResponseType)); Task.Run( () => method.Invoke(_connector.EndPoint, new[] { (object)Event.MetaData.Request }) ); }