コード例 #1
0
        /// <summary>
        /// 先进先出优先队列缓存
        /// </summary>
        /// <param name="sqlTable">数据表格</param>
        /// <param name="getKey">缓存关键字获取器</param>
        /// <param name="getTarget">获取节点</param>
        /// <param name="getWhere">条件表达式获取器</param>
        /// <param name="valueMember">节点成员</param>
        /// <param name="previousMember">前一个节点成员</param>
        /// <param name="nextMember">后一个节点成员</param>
        /// <param name="maxCount">缓存默认最大容器大小</param>
        public MemberQueueList(AutoCSer.Sql.Table <valueType, modelType> sqlTable, Func <modelType, keyType> getKey, Func <keyType, memberCacheType> getTarget
                               , Func <keyType, Expression <Func <modelType, bool> > > getWhere, Expression <Func <memberCacheType, ListArray <valueType> > > valueMember
                               , Expression <Func <memberCacheType, memberCacheType> > previousMember, Expression <Func <memberCacheType, memberCacheType> > nextMember
                               , int maxCount = 0)
            : base(valueMember, previousMember, nextMember, maxCount)
        {
            if (sqlTable == null)
            {
                throw new ArgumentNullException("sqlTool is null");
            }
            if (getKey == null)
            {
                throw new ArgumentNullException("getKey is null");
            }
            if (getTarget == null)
            {
                throw new ArgumentNullException("getTarget is null");
            }
            this.sqlTable  = sqlTable;
            this.getKey    = getKey;
            this.getTarget = getTarget;
            this.getWhere  = getWhere;
            //this.isRemoveEnd = isRemoveEnd;

            sqlTable.OnInserted += onInserted;
            sqlTable.OnUpdated  += onUpdated;
            sqlTable.OnDeleted  += onDeleted;
        }
コード例 #2
0
        /// <summary>
        /// 先进先出优先队列缓存
        /// </summary>
        /// <param name="sqlTable">数据表格</param>
        /// <param name="getKey">缓存关键字获取器</param>
        /// <param name="getTarget">获取节点</param>
        /// <param name="getCache">获取缓存数据</param>
        /// <param name="valueMember">节点成员</param>
        /// <param name="previousMember">前一个节点成员</param>
        /// <param name="nextMember">后一个节点成员</param>
        /// <param name="maxCount">缓存默认最大容器大小</param>
        public MemberQueueCustom(AutoCSer.Sql.Table <valueType, modelType> sqlTable, Func <modelType, keyType> getKey, Func <keyType, memberCacheType> getTarget
                                 , Func <keyType, cacheValueType> getCache, Expression <Func <memberCacheType, cacheValueType> > valueMember
                                 , Expression <Func <memberCacheType, memberCacheType> > previousMember, Expression <Func <memberCacheType, memberCacheType> > nextMember, int maxCount = 0)
            : base(valueMember, previousMember, nextMember, maxCount)
        {
            if (sqlTable == null)
            {
                throw new ArgumentNullException("sqlTable is null");
            }
            if (getKey == null)
            {
                throw new ArgumentNullException("getKey is null");
            }
            if (getTarget == null)
            {
                throw new ArgumentNullException("getTarget is null");
            }
            this.sqlTable  = sqlTable;
            this.getKey    = getKey;
            this.getTarget = getTarget;
            this.getCache  = getCache;

            sqlTable.OnInserted += onInserted;
            sqlTable.OnUpdated  += onUpdated;
            sqlTable.OnDeleted  += onDeleted;
        }
コード例 #3
0
 public static MemberMap <valueType> .MemberIndex CreateMemberIndex <valueType, returnType>(this AutoCSer.Sql.Table <valueType> sqlTable, Expression <Func <valueType, returnType> > member)
     where valueType : class
 {
     return(MemberMap <valueType> .MemberIndex.Create(member));
 }
コード例 #4
0
 public static MemberMap <valueType> .Builder CreateMemberMap <valueType>(this AutoCSer.Sql.Table <valueType> sqlTable)
     where valueType : class
 {
     return(new MemberMap <valueType> .Builder(sqlTable != null));
 }