public MongoSessionDocument() { ApplicationName = "WinDemo.Mongodb"; LockId = 0; Locked = false; Flags = 0; User = "******"; Timeout = 50; Created = DateTime.UtcNow; LockDate = DateTime.UtcNow; Expires = Created.AddMinutes(Timeout); SessionStateItemCollection col = new SessionStateItemCollection(); col["key1"] = new { ID = new Random().Next(100, 100000), Name = "ZY", Age = 11 }; col["key2"] = new { ID = new Random().Next(100, 100000), Name = "ZY", Age = 11 }; SessionItems = col; }
public virtual void EditDuration(int duration) { if (Ended == null) { throw new ArgumentException(); } Ended = Created.AddMinutes(duration); CalculatePriceAndDuration(); }
public bool IsExpired(int expiryLength) { if (Created.AddMinutes(expiryLength) < DateTime.Now) { return(true); } return(false); }
public SyncModel(string syncId, int total) { AgentsTiming = new ConcurrentDictionary <string, int?>(); Created = DateTime.Now; DeleteAt = Created.AddMinutes(60); SyncId = syncId; Total = total; Timeout = 3 * 60; }
public GameSessionListItem() { GameSessionId = null; Created = DateTime.UtcNow; ValidUntil = Created.AddMinutes(5); }