Пример #1
0
        /// <summary>
        /// 根据条件统计对象的所有数目
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="condition">统计条件</param>
        /// <returns>对象数量</returns>
        public static int count <T>(String condition) where T : IEntity
        {
            int countResult = ObjectPool.FindCount(typeof(T), condition);

            if (countResult == -1)
            {
                countResult = ObjectDB.Count(typeof(T), condition);
                ObjectPool.AddCount(typeof(T), condition, countResult);
            }

            return(countResult);
        }
Пример #2
0
 /// <summary>
 /// 根据条件统计数据量
 /// </summary>
 /// <param name="t"></param>
 /// <param name="condition">统计条件</param>
 /// <returns></returns>
 public static int count(Type t, String condition)
 {
     return(ObjectDB.Count(t, condition));
 }
Пример #3
0
 /// <summary>
 /// 统计 t 类型对象的所有数据量
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public static int count(Type t)
 {
     return(ObjectDB.Count(t));
 }