title: ObjectDataSource Update method with dynamic parameters
body: <p>I have this DataTable that has a varying set of columns except for a sequence number.</p>
  
  <p>| Sequence | Value | Tax | Duty | Total |</p>
  
  <p>Any number of columns should be accepted with unique column names.</p>
  
  <p>To display that table, I need to use an ObjectDataSource mapped to a presenter class with a Select method. </p>
  
  <pre><code>class Presenter {
      [DataObjectMethod(DataObjectMethodType.Select)]
      public DataView GetDutyAndTax() { ... }
  }
  </code></pre>
  
  <p>The ObjectDataSource is then bound to a GridView with AutoGenerateColumns set to true. Sequence is the data key.</p>
  
  <p>So far, that works for selecting the table. The problem comes when I need to update the table. The ObjectDataSource keeps nagging me to have an update method with the exact same parameters with that of the columns in the table.</p>
  
  <pre><code>public void EditDutyAndTax(string Value, string Tax, string Duty, string original_Sequence) { ... }
  </code></pre>
  
  <p>But I can not create a method like that because I don't know the set of columns needed.</p>
  
  <p>I tried using a method with variable parameter list but it doesn't want to use it.</p>
  
  <pre><code>public void EditDutyAndTax(params object[] values) { ... }
  </code></pre>
  
  <p>On idea I have now is to create a set of update methods like this in Presenter:</p>
  
  <pre><code>public void EditDutyAndTax(string value1, string original_Sequence) { ... }
  public void EditDutyAndTax(string value1, string value2, string original_Sequence) { ... }
  public void EditDutyAndTax(string value1, string value2, string value3, string original_Sequence) { ... }
  //an so on...
  </code></pre>
  
  <p>But I neither think that's gonna get through code review nor like the idea.</p>
  
  <p>The other idea I have is to create a dynamic method and attach that (if possible) to the Presenter class or wherever at runtime, but I'm not really sure if that would work.</p>
  
  <p>So if you guys have any solution, please help. Thanks so much!</p>
  
  <p>Carlos</p>