Beispiel #1
0
 public AuthenticateUser_Result Login([FromBody] User user)
 {
     try
     {
         using (var users = new UsersEntities())
         {
             return(users.AuthenticateUser(user.EmailOrPhone, Encrypt.EncryptPassword(user.Password)).FirstOrDefault());
         }
     }
     catch (Exception)
     {
         throw new UserNotExistException($"User {user.EmailOrPhone} cannot be found on the database.");
     }
 }