Define a method in interface which takes n parameters
<p>I am trying to define an interface and classes which implement the interface as below. The method defined in the interface accepts a string as argument where myClass2 implementation of the method <code>Execute</code> takes 2 arguments which doesn't follow the interface definition. </p>

<p>That's the problem. How could I define a method within an interface which takes n number of parameters of various type?</p>

<p>Please advice. Thanks.</p>

<pre><code>public interface MyInterface
{
     void Execute(string a);
}

public class myClass1 : MyInterface
{
     public void Execute(string a)
     {
        Console.WriteLine(a);
     }
}

public class myClass2 : MyInterface
{
     public void Execute(string a, int b)
     {
          Console.WriteLine(a);
          Console.WriteLine(b.ToString());
     }

}
</code></pre>

<p>EDIT: I am thinking of another approach. I appreciate if someone could tell me if this will be a better design.</p>

<pre><code>public interface IParameter
{
    Type ParameterType { get; set; }
    string Name { get; set; }
    object Value { get; set; }
}

public interface MyInterface 
{
     void Execute(Recordset recordSet, List&lt;IParameter&gt; listParams);
}

public class MyClass : MyInterface
{
      public void Execute(Recordset recordSet, List&lt;IParameter&gt; listParams)
      {

      }
}
</code></pre>

<p>I am passing a list of IParameter which holds all the required parameters which need to be sent.</p>
