示例#1
0
        private QueryComposerResponseDTO ExecuteRequest(string json, Dictionary <string, object> settings)
        {
            QueryComposerRequestDTO dto = Newtonsoft.Json.JsonConvert.DeserializeObject <DTO.QueryComposer.QueryComposerRequestDTO>(json);

            //The connection string to the Adapter's database.
            Adapters.PCORI.PCORIModelAdapter pcori = new Adapters.PCORI.PCORIModelAdapter();
            pcori.Initialize(settings);

            //Execute the query
            return(pcori.Execute(dto, false));
        }
示例#2
0
        private QueryComposerResponseQueryResultDTO ExecuteRequestForSingleResult(string json, Dictionary <string, object> settings)
        {
            var dto = Newtonsoft.Json.JsonConvert.DeserializeObject <DTO.QueryComposer.QueryComposerQueryDTO>(json);

            //The connection string to the Adapter's database.
            Adapters.PCORI.PCORIModelAdapter pcori = new Adapters.PCORI.PCORIModelAdapter(new RequestMetadata
            {
                CreatedOn   = DateTime.UtcNow,
                MSRequestID = "Unit Test Request"
            });
            pcori.Initialize(settings, Guid.NewGuid().ToString("D"));

            //Execute the query
            return(pcori.Execute(dto, false).FirstOrDefault());
        }