Exemple #1
0
 public void SendMessage(Models.Dialogue dialogue)
 {
     Task.Factory.StartNew(() =>
     {
         var unitOfWork = new UnitOfWork(_dbContext, _lockers);
         unitOfWork.TryAddDialogue(dialogue);
     });
 }
Exemple #2
0
        public void SendMessage(string recipient, string sender, string message)
        {
            var dialogue = new Models.Dialogue
            {
                DateTime      = DateTime.Now, Message = message,
                RecipientUser = new Models.User {
                    Login = recipient
                },
                SenderUser = new Models.User {
                    Login = sender
                }
            };
            var unitOfWork = new UnitOfWork(_dbContext, _lockers);

            unitOfWork.TryAddDialogue(dialogue);
        }