public Message Add(HttpRequestMessage request, MessageDto dto)
        {
            var username = request.GetRequestContext().Principal.Identity.Name;
            var profileId = uow.Accounts.GetAll()
                .Include(x => x.Profiles).Single(x => x.Email == username)
                .Profiles
                .First().Id;

            Conversation converation = dto.ConversationId == null ? new Conversation() : uow.Conversations.GetById(dto.ConversationId.Value);

            var message = new Message()
            {
                FromProfileId = profileId,
                ToProfileId = dto.ToProfileId,
                Subject = dto.Subject,
                Content = dto.Content,
                CreatedDate = DateTime.Now
            };

            if (dto.ConversationId == null)
            {
                converation.Messages.Add(message);
                uow.Conversations.Add(converation);
            }
            uow.SaveChanges();
            return message;
        }
 public void Send(MessageDto dto)
 {
     Clients.Others.broadcastMessage(dto);
 }