From 89813c2c4a964dd132d5e90a9dccfe01ea4bc2b5 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Tue, 27 Jun 2023 10:44:07 +0300 Subject: [PATCH 1/2] change graph.Delete returned value to bool --- src/NRedisStack/Graph/GraphCommands.cs | 9 +++++---- src/NRedisStack/Graph/GraphCommandsAsync.cs | 10 +++++----- src/NRedisStack/Graph/IGraphCommands.cs | 4 ++-- src/NRedisStack/Graph/IGraphCommandsAsync.cs | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/NRedisStack/Graph/GraphCommands.cs b/src/NRedisStack/Graph/GraphCommands.cs index 4f0481c2..647ed67e 100644 --- a/src/NRedisStack/Graph/GraphCommands.cs +++ b/src/NRedisStack/Graph/GraphCommands.cs @@ -85,15 +85,16 @@ public ResultSet CallProcedure(string graphName, string procedure, IEnumerable - public ResultSet Delete(string graphName) + public bool Delete(string graphName) { - var result = _db.Execute(GraphCommandBuilder.Delete(graphName)); - var processedResult = new ResultSet(result, _graphCaches[graphName]); + var result = _db.Execute(GraphCommandBuilder.Delete(graphName)).OKtoBoolean(); + // var processedResult = new ResultSet(result, _graphCaches[graphName]); _graphCaches.Remove(graphName); - return processedResult; + //return processedResult; + return result; } /// diff --git a/src/NRedisStack/Graph/GraphCommandsAsync.cs b/src/NRedisStack/Graph/GraphCommandsAsync.cs index 9e0d3192..b9548ec9 100644 --- a/src/NRedisStack/Graph/GraphCommandsAsync.cs +++ b/src/NRedisStack/Graph/GraphCommandsAsync.cs @@ -87,15 +87,15 @@ public async Task CallProcedureAsync(string graphName, string procedu /// - public async Task DeleteAsync(string graphName) + public async Task DeleteAsync(string graphName) { - var result = await _db.ExecuteAsync(GRAPH.DELETE, graphName); - - var processedResult = new ResultSet(result, _graphCaches[graphName]); + var result = (await _db.ExecuteAsync(GraphCommandBuilder.Delete(graphName))).OKtoBoolean(); + // var processedResult = new ResultSet(result, _graphCaches[graphName]); _graphCaches.Remove(graphName); - return processedResult; + //return processedResult; + return result; } /// diff --git a/src/NRedisStack/Graph/IGraphCommands.cs b/src/NRedisStack/Graph/IGraphCommands.cs index bd1a3100..3be792c4 100644 --- a/src/NRedisStack/Graph/IGraphCommands.cs +++ b/src/NRedisStack/Graph/IGraphCommands.cs @@ -79,9 +79,9 @@ public interface IGraphCommands /// Delete an existing graph. /// /// The graph to delete. - /// A result set. + /// if executed correctly, error otherwise/> /// - ResultSet Delete(string graphName); + bool Delete(string graphName); /// /// Constructs a query execution plan but does not run it. Inspect this execution plan to better understand how your diff --git a/src/NRedisStack/Graph/IGraphCommandsAsync.cs b/src/NRedisStack/Graph/IGraphCommandsAsync.cs index 46b84889..62ea118f 100644 --- a/src/NRedisStack/Graph/IGraphCommandsAsync.cs +++ b/src/NRedisStack/Graph/IGraphCommandsAsync.cs @@ -79,9 +79,9 @@ public interface IGraphCommandsAsync /// Delete an existing graph. /// /// The graph to delete. - /// A result set. + /// if executed correctly, error otherwise/> /// - Task DeleteAsync(string graphName); + Task DeleteAsync(string graphName); /// /// Constructs a query execution plan but does not run it. Inspect this execution plan to better understand how your From 27e5a3672876bf6ae985a3c696912da9434d2a95 Mon Sep 17 00:00:00 2001 From: shacharPash Date: Tue, 27 Jun 2023 11:30:43 +0300 Subject: [PATCH 2/2] delete comments --- src/NRedisStack/Graph/GraphCommands.cs | 5 ----- src/NRedisStack/Graph/GraphCommandsAsync.cs | 4 ---- 2 files changed, 9 deletions(-) diff --git a/src/NRedisStack/Graph/GraphCommands.cs b/src/NRedisStack/Graph/GraphCommands.cs index 647ed67e..59fc4f56 100644 --- a/src/NRedisStack/Graph/GraphCommands.cs +++ b/src/NRedisStack/Graph/GraphCommands.cs @@ -87,13 +87,8 @@ public ResultSet CallProcedure(string graphName, string procedure, IEnumerable public bool Delete(string graphName) { - var result = _db.Execute(GraphCommandBuilder.Delete(graphName)).OKtoBoolean(); - // var processedResult = new ResultSet(result, _graphCaches[graphName]); - _graphCaches.Remove(graphName); - - //return processedResult; return result; } diff --git a/src/NRedisStack/Graph/GraphCommandsAsync.cs b/src/NRedisStack/Graph/GraphCommandsAsync.cs index b9548ec9..cdbb7517 100644 --- a/src/NRedisStack/Graph/GraphCommandsAsync.cs +++ b/src/NRedisStack/Graph/GraphCommandsAsync.cs @@ -90,11 +90,7 @@ public async Task CallProcedureAsync(string graphName, string procedu public async Task DeleteAsync(string graphName) { var result = (await _db.ExecuteAsync(GraphCommandBuilder.Delete(graphName))).OKtoBoolean(); - // var processedResult = new ResultSet(result, _graphCaches[graphName]); - _graphCaches.Remove(graphName); - - //return processedResult; return result; }