protected override void ExecuteImpl <R>(QueryInfo <R> aQueryInfo) { int i = 0; aQueryInfo.Connection.execute( aQueryInfo.Query, delegate(SqlDataReader aReader) { if (Maximum > 0) { if (i >= Maximum) { return; } } Bind(aQueryInfo, aReader); i++; }, delegate(SqlCommand aCommand) { Notification = new AspNetNotication(CacheSpecs, new SqlCacheDependency(aCommand)); }, delegate() { AddToCache(); }); }
public void Add(string aKey, object aValue, AspNetNotication aNotification) { CacheSpec cacheSpecs = aNotification.GetCacheSpec(); CachePreference pref = cacheSpecs.GetCachePreferences(); cache.Add( aKey, aValue, aNotification.GetDependency(), DateTime.Now.AddSeconds(pref.CacheDuration), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Normal, new CacheItemRemovedCallback(this.CacheItemRemovedCallback) ); CachedKeys[aKey] = null; }
protected override void ExecuteImpl <R>(QueryInfo <R> aQueryInfo) { aQueryInfo.Connection.execute( aQueryInfo.Query, delegate(SqlDataReader aReader) { Bind(aQueryInfo, aReader); }, delegate(SqlCommand aCommand) { Notification = new AspNetNotication(CacheSpecs, null); }, delegate() { AddToCache(); }); }