From a27000a75b7e18b2f4475d98cabca4ec9e53a8ee Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 1 Dec 2025 16:29:41 +0100 Subject: [PATCH] Refactor DeleteRecActionsCommandHandler.Handle method Simplified the `Handle` method by removing the `async` modifier and replacing the `await` call with a direct `return` statement for `repo.DeleteAsync`. This optimization eliminates the overhead of creating an async state machine, as no additional asynchronous operations or logic are performed in the method. --- .../RecActions/Commands/DeleteRecActionsCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs b/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs index c1d0402..a6c6118 100644 --- a/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs +++ b/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs @@ -11,8 +11,8 @@ public class DeleteRecActionsCommand : IRequest public class DeleteRecActionsCommandHandler(IRepository repo) : IRequestHandler { - public async Task Handle(DeleteRecActionsCommand request, CancellationToken cancel) + public Task Handle(DeleteRecActionsCommand request, CancellationToken cancel) { - await repo.DeleteAsync(act => act.ProfileId == request.ProfileId, cancel); + return repo.DeleteAsync(act => act.ProfileId == request.ProfileId, cancel); } } \ No newline at end of file