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); }
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); }
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); }