public virtual List <T> ReadAsDbObjectList <T>() { List <T> list; try { this.BeginExecute(); this.InitPageCount(); int startIndex = (this.PageNumber - 1) * this.PageSize; if (this.RecordCount > 0) { StringBuilder builder = new StringBuilder(this.Select.Length + 40); builder.Append(this.Select); builder.Append(this.Condition.ToString()); using (DbCommandWrapped wrapped = this.DbHelper.CreateDbCommandWrapped(builder.ToString(), this.Condition.Parameters)) { return(wrapped.ExecuteDbObjectList <T>(startIndex, this.PageSize)); } } list = new List <T>(); } finally { this.EndExecute(); } return(list); }
protected List <T> ExecuteDbObjectList <T>(DbCommandWrapped command) { using (command) { return(command.ExecuteDbObjectList <T>()); } }
public override List <T> ReadAsDbObjectList <T>() { List <T> list; try { this.BeginExecute(); this.InitPageCount(); if (base.RecordCount > 0) { string queryCommand = this.GetQueryCommand(); using (DbCommandWrapped wrapped = base.DbHelper.CreateDbCommandWrapped(queryCommand.ToString(), base.Condition.Parameters)) { return(wrapped.ExecuteDbObjectList <T>()); } } list = new List <T>(); } finally { this.EndExecute(); } return(list); }