示例#1
0
 public PrivateMessageVM SetPMProperties(PrivateMessageVM privateMessageVM, string userid)
 {
     var userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(db));
     privateMessageVM.PM.receiverId = userManager.FindByName(privateMessageVM.UserName).Id;
     privateMessageVM.PM.senderId = userManager.FindById(userid).Id;
     return privateMessageVM;
 }
示例#2
0
 public void SaveNewMessageToDatabase(PrivateMessageVM privateMessageVM)
 {
     db.message.Add(privateMessageVM.PM);
     db.SaveChanges();
 }