C# 如何通过代表和;“正常类型”;函数中的参数

C# 如何通过代表和;“正常类型”;函数中的参数,c#,C#,我将用代码直接解释我的问题。最初,我的代码如下: class Program { private static Obj A = new Obj(...); private static void Function(Func<object[]> m) { object[] result = m(); ... } static void main() { double a,b,c = 0; strin

我将用代码直接解释我的问题。最初,我的代码如下:

class Program
{
   private static Obj A = new Obj(...);

   private static void Function(Func<object[]> m)
   {
      object[] result = m();
      ...
   }

   static void main()
   {
      double a,b,c = 0;
      string d = " ";
      Function(() => A.MethodX(a,b,c));
      Function(() => A.MethodY(d,a,b));
      ...
   }
}
类程序
{
私有静态对象A=新对象(…);
专用静态无效函数(Func m)
{
对象[]结果=m();
...
}
静态void main()
{
双a,b,c=0;
字符串d=“”;
函数(()=>A.MethodX(A,b,c));
函数(()=>A.MethodY(d,A,b));
...
}
}
这允许我使用相同的函数,在该函数中,我可以使用对象的任何方法。现在,我要问的是:在这个函数中是否可能有另一个参数,所以它会是这样的:

class Program
{
   private static Obj A = new Obj(...);

   private static void Function(List<string> b, Func<object[]> m)
   {
      object[] result = m();
      ...uses my other argument
   }

   static void main()
   {
      List<string> x = new List<string>();
      double a,b,c = 0;
      string d = " ";
      //Function(() => A.MethodX(a,b,c)); -> How to give my List named "x" to the Function ?
      ...
   }
}
类程序
{
私有静态对象A=新对象(…);
私有静态无效函数(列表b,函数m)
{
对象[]结果=m();
…用我的另一个论点
}
静态void main()
{
列表x=新列表();
双a,b,c=0;
字符串d=“”;
//函数(()=>A.MethodX(A,b,c));->如何为函数提供名为“x”的列表?
...
}
}
如果是,我如何实施


谢谢

简单;将
x
作为第一个参数传递:

static void main()
{
    List<string> x = new List<string>();
    double a,b,c = 0;
    string d = " ";
    Function(x, () => A.MethodX(a,b,c)); 
}
static void main()
{
列表x=新列表();
双a,b,c=0;
字符串d=“”;
函数(x,()=>A.MethodX(A,b,c));
}

@user234461因为
a
b
未分配?为了简洁起见,代码显然被省略了。