Beispiel #1
0
 /// <summary>
 /// 获取一个匹配数据
 /// </summary>
 /// <param name="key">关键字</param>
 /// <param name="isValue">数据匹配器,禁止数据库与锁操作</param>
 /// <returns>匹配数据,失败返回null</returns>
 public ReturnValue <valueType> FirstOrDefault(keyType key, Func <valueType, bool> isValue)
 {
     if (isValue != null)
     {
         FindTask task = new FindTask(this, key, isValue);
         counter.SqlTable.AddQueue(task);
         return(task.Wait());
     }
     return(ReturnType.ArgumentNull);
 }
Beispiel #2
0
        /// <summary>
        /// 获取一个匹配数据
        /// </summary>
        /// <param name="key">关键字</param>
        /// <param name="isValue">数据匹配器,禁止数据库与锁操作</param>
        /// <returns>匹配数据,失败返回null</returns>
        public valueType FirstOrDefault(keyType key, Func <valueType, bool> isValue)
        {
            if (isValue == null)
            {
                throw new ArgumentNullException();
            }
            FindTask task = new FindTask(this, key, isValue);

            counter.SqlTable.AddQueue(task);
            return(task.Wait());
        }