//[AspectSwitcher(true)] public virtual UserInfo GetUserInfo(string name, out string userid, out Guid guid, out UserInfo user) { //Thread.Sleep(60000); var context = OperationContext.Current; //var count = new Random(Guid.NewGuid().GetHashCode()).Next(1, 100) * new Random(Guid.NewGuid().GetHashCode()).Next(1, 100); //if (count % 5 == 0) //{ // throw new UserException("Error Count: " + count); //} //else if (count % 6 == 0) //{ // Thread.Sleep(new Random().Next(1, 10) * 1000); //} user = new UserInfo() { Name = name, Description = string.Format("您的用户名为:{0}", name) }; userid = user.Name; try { guid = new Guid(userid.Split('_')[1]); } catch { guid = Guid.NewGuid(); } //int value = new Random().Next(1, 5); //Thread.Sleep(value * 1000); Console.WriteLine("{0} => {1}", DateTime.Now, guid); //Thread.Sleep(10); return user; }
public string GetDateTime(Guid guid, DateTime time, UserInfo user, Sex sex) { return string.Format("{0} => {1}", guid, DateTime.Now); }
//private DateTime startTime; //public UserService() //{ // this.startTime = DateTime.Now; //} public string GetUser(UserInfo user) { return user.Name; }