using Application.Abstractions.Data; using Application.Abstractions.Messaging; using Microsoft.EntityFrameworkCore; using SharedKernel.Results; namespace Application.Features.Admin.Store.GameCatalog.Delete; internal sealed class Handler(IAppDbContext db) : ICommandHandler { public async Task Handle(Command request, CancellationToken ct) { var row = await db.GameProductCatalog.FirstOrDefaultAsync(c => c.ID == request.ID, ct); if (row is null) { return Result.Failure(Error.NotFound("GameCatalog.NotFound", "카탈로그 항목을 찾을 수 없습니다.")); } db.GameProductCatalog.Remove(row); await db.SaveChangesAsync(ct); return Result.Success(); } }