コード例 #1
0
        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();
            });
        }
コード例 #2
0
ファイル: AspNetCache.cs プロジェクト: eliemelki/CSharp-ORM
        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;
        }
コード例 #3
0
 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();
     });
 }