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:
parent
e74ee56f42
commit
a27000a75b
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user