public async Task <bool> ValidatorAsync(IUserQueryService querySerice, User user) { Ensure.NotNull(querySerice, "UserValidator.UserQueryService"); Ensure.NotNull(user, "UserValidator.User"); var list = await querySerice.FindUsersAsync(user.Account); if (list.Any()) { throw new Exception("用户账号已存在,请重新输入!"); } return(true); }