using Indotalent.Infrastructure.Database; using MediatR; using Microsoft.EntityFrameworkCore; namespace Indotalent.Features.Serilogs.Database; public record DeleteSerilogLogsAllCommand() : IRequest; public class DeleteSerilogLogsHandler : IRequestHandler { private readonly AppDbContext _context; public DeleteSerilogLogsHandler(AppDbContext context) { _context = context; } public async Task Handle(DeleteSerilogLogsAllCommand request, CancellationToken cancellationToken) { await _context.Database.ExecuteSqlRawAsync("TRUNCATE TABLE SerilogLogs", cancellationToken); return true; } }