Пример #1
0
        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);
        }
Пример #2
0
 public ChallengeClosedDomainEvent(ChallengeId challengeId, ChallengeParticipantPayouts payouts)
 {
     ChallengeId = challengeId;
     Payouts     = payouts;
 }