initial commit

This commit is contained in:
2026-07-21 14:14:44 +07:00
commit fa7dbb970d
1359 changed files with 104110 additions and 0 deletions
@@ -0,0 +1,30 @@
using Indotalent.Infrastructure.Database;
using MediatR;
namespace Indotalent.Features.Serilogs.Database;
public record DeleteSerilogLogsByIdCommand(int Id) : IRequest<bool>;
public class DeleteSerilogLogsByIdHandler :
IRequestHandler<DeleteSerilogLogsByIdCommand, bool>
{
private readonly AppDbContext _context;
public DeleteSerilogLogsByIdHandler(AppDbContext context)
{
_context = context;
}
public async Task<bool> Handle(DeleteSerilogLogsByIdCommand request, CancellationToken cancellationToken)
{
var log = await _context.Set<Data.Entities.SerilogLogs>().FindAsync(request.Id);
if (log == null) return false;
_context.Set<Data.Entities.SerilogLogs>().Remove(log);
return await _context.SaveChangesAsync(cancellationToken) > 0;
}
}