예제 #1
0
 public MessageViewModel(Message message)
 {
     Text = message.Text;
     Created = message.CreatedTime;
     ReciverId = message.ReceiverId;
     SenderId = message.SenderId;
     SenderEmail = message.Sender.UserName;
     ReciverEmail = message.Receiver.UserName;
 }
예제 #2
0
 public void AddMessage(Message message)
 {
     using (var context = new DataBaseContext())
     {
         message.CreatedTime = DateTime.UtcNow;
         context.Messages.Add(message);
         context.SaveChanges();
     }
 }
예제 #3
0
 public void AddMessage(Message message)
 {
     messageRepository.AddMessage(message);
 }