using MediatR; using Modules.Library.Application.Gateways; namespace Modules.Library.Application.Commands.Anime.Title.Properties.Genre; public class SetGenreProportionCommand : IRequest { public Guid TitleId { get; set; } public Guid GenreId { get; set; } public decimal? Proportion { get; set; } } public class SetGenreProportionCommandHandler(IAnimeTitleGateway titleGateway) : IRequestHandler { public async Task Handle(SetGenreProportionCommand request, CancellationToken cancellationToken) { var title = await titleGateway.GetById(request.TitleId); title.CommonProperties.SetGenreProportion(request.GenreId, request.Proportion); await titleGateway.Update(title); return Unit.Value; } }