private async Task <IEnumerable <string> > ExecuteSynonymQueryAsync(MatchSynonymsQuery query) { List <IRecord> result = await _neoGraphCluster.Run(GraphReplicaSetNames.Published, query); //todo: (at least some of) this code belongs in the queries ProcessRecord() //todo: revisit null handling IReadOnlyDictionary <string, object>?synonymResults = (IReadOnlyDictionary <string, object>?)result.FirstOrDefault()?.Values["results"]; return(((List <object>?)synonymResults?.Values.FirstOrDefault())?.OfType <string>() ?? Enumerable.Empty <string>()); }
private async Task <IEnumerable <string> > ExecuteSynonymQueryAsync(MatchSynonymsQuery query) { var result = await _neoGraphCluster.Run(GraphReplicaSetNames.Published, query); IReadOnlyDictionary <string, object> synonymResults = (IReadOnlyDictionary <string, object>)result.FirstOrDefault().Values["results"]; var synonymList = ((List <object>)synonymResults.Values.FirstOrDefault()).OfType <string>(); return(synonymList); }