namespace Netina.Repository.Handlers.Faqs; public class UpdateFaqCommandHandler(IMartenRepositoryWrapper martenRepositoryWrapper) : IRequestHandler { public async Task Handle(UpdateFaqCommand request, CancellationToken cancellationToken) { var ent = await martenRepositoryWrapper.SetRepository() .GetEntityAsync(request.Id, cancellationToken); if (ent == null) throw new BaseApiException(ApiResultStatusCode.NotFound, "Faq not found"); var newEnt = new BaseFaq { Id = ent.Id, Faqs = request.Faqs, Slug = request.Slug, Title = request.Title }; await martenRepositoryWrapper.SetRepository() .UpdateEntityAsync(newEnt, cancellationToken); return true; } }