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.
This commit is contained in:
tekh 2025-12-01 16:29:41 +01:00
parent e74ee56f42
commit a27000a75b

View File

@ -11,8 +11,8 @@ public class DeleteRecActionsCommand : IRequest
public class DeleteRecActionsCommandHandler(IRepository<RecAction> repo) : IRequestHandler<DeleteRecActionsCommand> public class DeleteRecActionsCommandHandler(IRepository<RecAction> repo) : IRequestHandler<DeleteRecActionsCommand>
{ {
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);
} }
} }