Beispiel #1
0
        /// <summary>
        /// 根据 id 删除数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="id">对象的 id</param>
        /// <returns>返回受影响的行数</returns>
        public static int delete <T>(int id) where T : IEntity
        {
            int num = ObjectDb.Delete(typeof(T), id);

            ObjectPool.Delete(typeof(T), id);
            return(num);
        }
Beispiel #2
0
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>返回受影响的行数</returns>
        public static int delete(Object obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException();
            }

            int num = ObjectDb.Delete((IEntity)obj);

            ObjectPool.Delete((IEntity)obj);
            return(num);
        }