// Account controller public async Task <AppUser> RegisterUser(RegisterDto registerDto) { using var hmac = new HMACSHA512(); AppUser user = new AppUser() { UserName = registerDto.Username.ToLower(), PasswordHash = hmac.ComputeHash(Encoding.UTF8.GetBytes(registerDto.Password)), PasswordSalt = hmac.Key }; return(await _repo.RegisterUser(user)); }