using Application.Abstractions.Data; using Application.Abstractions.Messaging; using Microsoft.EntityFrameworkCore; namespace Application.Features.Api.DonationAlert.DeleteConfig; internal sealed class Handler(IAppDbContext db) : ICommandHandler { public async Task Handle(Command request, CancellationToken ct) { var config = await db.DonationAlertConfig .FirstOrDefaultAsync(c => c.ID == request.ID && c.ChannelID == request.ChannelID, ct); if (config is null) { return; } db.DonationAlertConfig.Remove(config); await db.SaveChangesAsync(ct); } }