public ResultSet(RedisResult result, GraphCache graphCache) { if (result.Type == ResultType.MultiBulk) { var resultArray = (RedisResult[])result; _graphCache = graphCache; if (resultArray.Length == 3) { Header = new Header(resultArray[0]); Statistics = new Statistics(resultArray[2]); _rawResults = (RedisResult[])resultArray[1]; Count = _rawResults.Length; } else { Statistics = new Statistics(resultArray[resultArray.Length - 1]); Count = 0; } } else { Statistics = new Statistics(result); Count = 0; } }
internal ResultSet(RedisResult result, GraphCache graphCache) { if (result.Type == ResultType.MultiBulk) { var resultArray = (RedisResult[])result; ScanForErrors(resultArray); _graphCache = graphCache; if (resultArray.Length == 3) { Header = new Header(resultArray[0]); Statistics = new Statistics(resultArray[2]); _rawResults = (RedisResult[])resultArray[1]; Count = _rawResults.Length; } else { Statistics = new Statistics(resultArray[resultArray.Length - 1]); Count = 0; } } else { if (result.Type == ResultType.Error) { throw new NRedisGraphRunTimeException(result.ToString()); } Statistics = new Statistics(result); Count = 0; } }