private async Task <UserDetailsDto> GetUserInfo(string username)
 {
     using (var connection = await DbConnectionFactory.GetOpenMySqlConnectionAsync())
     {
         return(await connection.QueryFirstOrDefaultAsync <UserDetailsDto>(
                    "SELECT * FROM app_users WHERE username = @Username",
                    new
         {
             Username = username
         }));
     }
 }
 private async Task <string> GetHashedPasswordFromTable(string username)
 {
     using (var connection = await DbConnectionFactory.GetOpenMySqlConnectionAsync())
     {
         return(await connection.QueryFirstOrDefaultAsync <string>(
                    "SELECT password FROM app_users WHERE username = @Username",
                    new
         {
             Username = username
         }));
     }
 }
        public async Task CreateNewUser(UserDetailsDto user)
        {
            var hashedPassword = PasswordHasher.HashPassword(user, user.Password);

            using (var connection = await DbConnectionFactory.GetOpenMySqlConnectionAsync())
            {
                await connection.ExecuteAsync(
                    @"INSERT INTO app_users
                         (username, password) 
                        VALUES 
                         (@Username, @Password)",
                    new
                {
                    Username = user.Username,
                    Password = hashedPassword
                });
            }
        }