/// <summary> /// 获取用户数量 /// </summary> public string GetUserCount() { List <string> list = new List <string>(); list.Add(_identityContract.Users.Count().ToString()); list.Add(_identityContract.GetHashCode().ToString()); return(list.ExpandAndToString()); }
public async Task Run(IJobCancellationToken cancelToken) { for (int i = 0; i < 50; i++) { cancelToken.ThrowIfCancellationRequested(); IIdentityContract contract = _serviceProvider.GetService <IIdentityContract>(); Debug.WriteLine($"HashCode:{contract.GetHashCode()}---{i}"); await Task.Delay(1000, cancelToken.ShutdownToken); } }