MonkeyWrench.DB.GetDBRevisions C# (CSharp) Method

GetDBRevisions() public method

public GetDBRevisions ( int lane_id, int limit, int offset, bool ordered = true ) : List
lane_id int
limit int
offset int
ordered bool
return List
		public List<DBRevision> GetDBRevisions (int lane_id, int limit, int offset, bool ordered = true)
		{
			List<DBRevision> result = new List<DBRevision> ();

			using (IDbCommand cmd = CreateCommand ()) {
				cmd.CommandText = "SELECT * FROM Revision WHERE lane_id = @lane_id";
				if (ordered)
					cmd.CommandText += " ORDER BY date DESC";
				if (limit > 0)
					cmd.CommandText += " LIMIT " + limit.ToString ();
				if (offset > 0)
					cmd.CommandText += " OFFSET " + offset.ToString ();
				DB.CreateParameter (cmd, "lane_id", lane_id);
				using (IDataReader reader = cmd.ExecuteReader ()) {
					while (reader.Read ()) {
						result.Add (new DBRevision (reader));
					}
				}
			}

			return result;
		}

Same methods

DB::GetDBRevisions ( int lane_id, bool ordered ) : DBRevision>.Dictionary
DB::GetDBRevisions ( int lane_id, int limit, bool ordered = true ) : List