예제 #1
0
        private async Task UpdateAndPublish(Payment p)
        {
            var up = Builders <Payment> .Update
                     .Set(pp => pp.Status, p.Status);

            await _payments.UpdateOneAsync(u => u.Id == p.Id, up);

            _publisher.PublishNewPaymentStatus(new NewPaymentStatus()
            {
                Status    = p.Status.Parse(),
                OrderId   = p.OrderId,
                PaymentId = p.Id
            });
        }