public async Task <bool> RegisterAsync(string username, string email, string password, int libraryId) { var user = new User { LibraryId = libraryId, Username = username, Email = email, Password = _passwordHash.CreateHash(password), CreatedAt = DateTime.Now }; _unitOfWork.Users.Add(user); return(await _unitOfWork.CommitAsync() == 1); }