MonkeyWrench.DB.GetRevisions C# (CSharp) Method

GetRevisions() public method

public GetRevisions ( string lane, int limit ) : List
lane string
limit int
return List
		public List<int> GetRevisions (string lane, int limit)
		{
			List<int> result = new List<int> ();

			using (IDbCommand cmd = CreateCommand ()) {
				cmd.CommandText = "SELECT DISTINCT CAST (revision as int) FROM revisions WHERE lane = @lane ORDER BY revision DESC";
				if (limit > 0)
					cmd.CommandText += " LIMIT " + limit.ToString ();
				DB.CreateParameter (cmd, "lane", lane);
				using (IDataReader reader = cmd.ExecuteReader ()) {
					while (reader.Read ())
						result.Add (reader.GetInt32 (0));
				}
			}

			return result;
		}