public IInsertBuilder <T> InsertBuilder <T>() { string entityName = typeof(T).Name; string key = string.Format("IInsertBuilder_{0}", entityName); object value = null; if (!dicBuilder.TryGetValue(key, out value)) { value = new InsertBuilder <T>(dalInfo, GetKeyName(entityName), GetIdentityName(entityName), this); dicBuilder.Add(key, value); } return((InsertBuilder <T>)value); }
public IInsertBuilder <T> InsertBuilder <T>() { string entityName = typeof(T).Name; if (Thread.CurrentThread.ManagedThreadId != this.initThreadId) { return(new InsertBuilder <T>(dalInfo, GetKeyName(entityName), GetIdentityName(entityName))); } string key = string.Format("IInsertBuilder_{0}", entityName); object value = null; if (!dicBuilder.TryGetValue(key, out value)) { value = new InsertBuilder <T>(dalInfo, GetKeyName(entityName), GetIdentityName(entityName)); dicBuilder.Add(key, value); } return((InsertBuilder <T>)value); }