Пример #1
0
        public async Task <bool> UpdateMessageAsync(Message message)
        {
            var messageCosmos = new MessageCosmos
            {
                Id   = message.Id.ToString(),
                Text = message.Text
            };

            var response = await _cosmosStore.UpdateAsync(messageCosmos);

            return(response.IsSuccess);
        }
Пример #2
0
        public async Task <bool> CreateMessageAsync(Message message)
        {
            var messageCosmos = new MessageCosmos
            {
                Id   = Guid.NewGuid().ToString(),
                Text = message.Text
            };

            var response = await _cosmosStore.AddAsync(messageCosmos);

            message.Id = Guid.Parse(messageCosmos.Id);
            return(response.IsSuccess);
        }