Example #1
0
        /// <summary>根据主键数组删除数据</summary>
        /// <param name="keys"></param>
        /// <returns>是否删除成功</returns>
        public virtual Boolean[] Delete(Object[] keys)
        {
            if (keys == null)
            {
                return(null);
            }
            if (keys.Length < 1)
            {
                return(new Boolean[0]);
            }

            var rs = new Boolean[keys.Length];

            for (int i = 0; i < keys.Length; i++)
            {
                var entity = Facotry.FindByKey(keys[i]);
                if (entity != null)
                {
                    entity.Delete();
                    rs[i] = true;
                }
            }

            return(rs);
        }
Example #2
0
        /// <summary>根据主键数组检查数据是否仍然存在</summary>
        /// <param name="keys"></param>
        /// <returns>是否存在</returns>
        public virtual Boolean[] CheckExists(Object[] keys)
        {
            if (keys == null)
            {
                return(null);
            }
            if (keys.Length < 1)
            {
                return(new Boolean[0]);
            }

            var rs = new Boolean[keys.Length];

            for (Int32 i = 0; i < keys.Length; i++)
            {
                var entity = Facotry.FindByKey(keys[i]);
                if (entity != null)
                {
                    rs[i] = true;
                }
            }

            return(rs);
        }