我试图通过传递一些参数(args1,args2)从类 A 调用类 B 的构造函数。我正在使用这样的东西:
public class A
{
private readonly B _b;
public A()
{
_b=new B(TypeA args1,TypeB args2);
}
...
}
public class B
{
public B(TypeA new_args1,TypeB new_args2)
{
...
}
...
}
但是从我在调试中看到的 args1 和 args2 具有我想要发送的正确值,new_args1 和 new_args2 不会改变。有没有我必须使用的特定语法来做到这一点?