ReC/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs
TekH a27000a75b 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.
2025-12-01 16:29:41 +01:00

18 lines
549 B
C#

using DigitalData.Core.Abstraction.Application.Repository;
using MediatR;
using ReC.Domain.Entities;
namespace ReC.Application.RecActions.Commands;
public class DeleteRecActionsCommand : IRequest
{
public long ProfileId { get; init; } = 2;
}
public class DeleteRecActionsCommandHandler(IRepository<RecAction> repo) : IRequestHandler<DeleteRecActionsCommand>
{
public Task Handle(DeleteRecActionsCommand request, CancellationToken cancel)
{
return repo.DeleteAsync(act => act.ProfileId == request.ProfileId, cancel);
}
}