MonkeyWrench.DB.GetCommands C# (CSharp) Method

GetCommands() public method

public GetCommands ( int lane_id ) : List
lane_id int
return List
		public List<DBCommand> GetCommands (int lane_id)
		{
			List<DBCommand> result = new List<DBCommand> ();

			using (IDbCommand cmd = CreateCommand ()) {
				cmd.CommandText = "SELECT * FROM Command ";
				if (lane_id > 0) {
					cmd.CommandText += "WHERE lane_id = @lane_id ";
					DB.CreateParameter (cmd, "lane_id", lane_id);
				}
				cmd.CommandText += "ORDER BY sequence ASC";
				using (IDataReader reader = cmd.ExecuteReader ()) {
					while (reader.Read ())
						result.Add (new DBCommand (reader));
				}
			}

			return result;
		}