public EsfQuerySessionResponseFixture RunQuery(object mapping, object[] documents, object query) { string serializedMapping = JSON.Serialize(mapping); string[] serializedDocuments = documents.Select((document) => JSON.Serialize(document)).ToArray(); string serializedQuery = JSON.Serialize(query); var esfSessionResponse = _esfQueryRunner.Run(serializedMapping, serializedDocuments, serializedQuery).Result; return(new EsfQuerySessionResponseFixture(esfSessionResponse)); }
public async Task <EsfRunResponseDto> Post([FromBody] EsfQueryRunnerDto esfState) { EsfQueryRunResult runResult = await _queryRunner.Run(esfState.Mapping, esfState.Documents.ToArray(), esfState.Query); EsfRunResponseDto mappedResult = _mapper.Map <EsfRunResponseDto>(runResult); return(mappedResult); }