Skip to content

Commit

Permalink
Simplified delete command
Browse files Browse the repository at this point in the history
  • Loading branch information
m4-used-rollout committed Dec 14, 2023
1 parent 88313ae commit 76c05a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TPP.Persistence.MongoDB/Repos/ResponseCommandRepo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public async Task<ResponseCommand> UpsertCommand(string command, string response

public async Task<bool> RemoveCommand(string command)
{
DeleteResult deleteOneAsync = await Collection.DeleteOneAsync(c => c.Command.Equals(command, StringComparison.InvariantCultureIgnoreCase));
var commandLower = command.ToLower();
DeleteResult deleteOneAsync = await Collection.DeleteOneAsync(c => c.Command == command || c.Command == commandLower);
CommandRemoved?.Invoke(this, command);
return deleteOneAsync.DeletedCount > 0;
}
Expand Down

0 comments on commit 76c05a4

Please sign in to comment.