public static UserCollection WhoIsOnline(int pastMinutes) {
UserCollection users;
// Read from the cache if available
if (HttpContext.Current.Cache["WhoIsOnline"] == null) {
// Create Instance of the IWebForumsDataProviderBase
IWebForumsDataProviderBase dp = DataProvider.Instance();
// Get the users
users = dp.WhoIsOnline(pastMinutes);
// Add to the Cache
HttpContext.Current.Cache.Insert("WhoIsOnline", users, null, DateTime.Now.AddSeconds(30), TimeSpan.Zero);
}
return (UserCollection) HttpContext.Current.Cache["WhoIsOnline"];
}