public void Add(ChatMessage entity)
        {
            if(!_initialized)
            {
                Initialize();
            }

            var tableEntity = new ChatMessageTableEntity(entity.Name)
            {
                Message = entity.Message
            };

            TableOperation insertOperation = TableOperation.Insert(tableEntity);

            _table.Execute(insertOperation);
        }
Пример #2
0
        public void Send(string name, string message)
        {
            try
            {
                //Save first
                var chatMsg = new ChatMessage()
                {
                    Name = name,
                    Message = message
                };

                _messagePersister.Add(chatMsg);

                //then broadcast
                Clients.All.broadcastMessage(name, message);
            }
            catch(Exception) //All exceptions
            {
                Clients.Caller.showError("Generic error occured");
            }
        }
 public void Update(ChatMessage entity)
 {
     throw new NotImplementedException();
 }