namespace Netina.Repository.Handlers.Reviews; public class DeleteReviewCommandHandler(IRepositoryWrapper repositoryWrapper) : IRequestHandler { public async Task Handle(DeleteReviewCommand request, CancellationToken cancellationToken) { var review = await repositoryWrapper.SetRepository().TableNoTracking .FirstOrDefaultAsync(r => r.Id == request.Id, cancellationToken); if (review == null) throw new AppException("Review not found", ApiResultStatusCode.NotFound); repositoryWrapper.SetRepository().Delete(review); await repositoryWrapper.SaveChangesAsync(cancellationToken); return true; } }