public static async Task PublishChallengeClosedIntegrationEventAsync( this IServiceBusPublisher publisher, ChallengeId challengeId, ChallengeParticipantPayouts payouts ) { var integrationEvent = new ChallengeClosedIntegrationEvent { ChallengeId = challengeId, PayoutPrizes = { payouts.ToDictionary( payoutPrize => payoutPrize.Key.ToString(), payoutPrize => new CurrencyDto { Amount = payoutPrize.Value.Amount, Type = payoutPrize.Value.Type.ToEnum <EnumCurrencyType>() }) } }; await publisher.PublishAsync(integrationEvent); }
public ChallengeClosedDomainEvent(ChallengeId challengeId, ChallengeParticipantPayouts payouts) { ChallengeId = challengeId; Payouts = payouts; }