Exemplo n.º 1
0
        public IDeleteBuilder <T> DeleteBuilder <T>()
        {
            string entityName = typeof(T).Name;
            string key        = string.Format("IDeleteBuilder_{0}", entityName);
            object value      = null;

            if (!dicBuilder.TryGetValue(key, out value))
            {
                value = new DeleteBuilder <T>(dalInfo, GetKeyName(entityName), this);
                dicBuilder.Add(key, value);
            }
            return((DeleteBuilder <T>)value);
        }
Exemplo n.º 2
0
        public IDeleteBuilder <T> DeleteBuilder <T>()
        {
            string entityName = typeof(T).Name;

            if (Thread.CurrentThread.ManagedThreadId != this.initThreadId)
            {
                return(new DeleteBuilder <T>(dalInfo, GetKeyName(entityName)));
            }
            string key   = string.Format("IDeleteBuilder_{0}", entityName);
            object value = null;

            if (!dicBuilder.TryGetValue(key, out value))
            {
                value = new DeleteBuilder <T>(dalInfo, GetKeyName(entityName));
                dicBuilder.Add(key, value);
            }
            return((DeleteBuilder <T>)value);
        }
Exemplo n.º 3
0
        private void AddDeleteObject(Delete_ iDelete)
        {
            DeleteObject deleteObject = new DeleteBuilder <T> .DeleteObject();

            deleteObject.Delete = iDelete;

            if (tranBuilder != null)
            {
                deleteObject.CmdIndex = tranBuilder.GetCmdTextsCount();

                // 在集合中站位,等创建脚本的时候再将内容填充
                tranBuilder.AddCommondType(CommandType.Text);
                tranBuilder.AddCmdText(null);
                tranBuilder.AddCmdParam(null);
            }
            else
            {
                // 不是事务操作时,一次只操作一条语句
                this.listDeleteObject.Clear();
                deleteObject.CmdIndex = this.listDeleteObject.Count;
            }
            this.listDeleteObject.Add(deleteObject);
        }