public bool ChangePassword(User user, string outPassword, string newPassword)
 {
     user = context.Users.Where(u => user.Id == u.Id).FirstOrDefault();
     if (user.Password == outPassword)
     {
         user.Password = newPassword;
         context.SaveChanges();
         return(true);
     }
     return(false);
 }
예제 #2
0
 public Chat CreateChat(Chat chat)
 {
     context.Chats.Add(chat);
     context.SaveChanges();
     return(chat);
 }