Пример #1
0
        private async Task NotifyBalanceUpdate()
        {
            var balanceUpdate = new BalanceUpdateMessage
            {
                AccountNumber = (int)this.GetPrimaryKeyLong(),
                Balance       = this.State.Value
            };

            var message = new Message(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(balanceUpdate)));
            await serviceBusClient.SendMessageAsync(message);
        }
Пример #2
0
        private static async Task SendData(List <ExternalApiAuthor> authors, IServiceBusClient serviceBusClient)
        {
            foreach (var author in authors)
            {
                var message = new MessageModel
                {
                    Author    = author,
                    Operation = ReadOrWrite.Write,
                };

                await serviceBusClient.SendMessageAsync(message);
            }
        }