예제 #1
0
        public async Task <JArray> getRecordArray(string type,
                                                  string queryJson, string optionsJson)
        {
            try
            {
                var list = await NonSecrets.OpenSearchAsync(
                    d_openWallet, type, queryJson, optionsJson);

                // get 0 schema's
                var res = await NonSecrets.FetchNextRecordsAsync(
                    d_openWallet, list, 0);

                // parse result to see the count of schema's
                JObject o     = JObject.Parse(res);
                string  count = o["totalCount"].ToString();

                // return "0" if there are no records for the type and query
                if (count == "0")
                {
                    return(null);
                }

                // get count schema's
                res = await NonSecrets.FetchNextRecordsAsync(
                    d_openWallet, list, Int32.Parse(count));

                // make response human readable
                o = JObject.Parse(res);

                return((JArray)o["records"]);
            }
            catch (Exception e)
            {
                throw e;
            }
        }