我无法弄清楚这将如何工作:
public Class1 Function1()
{
DataTable dt;
try
{
dt = new DataTable();
//.. Do some work
return new Class2(byref dt);
}
finally
{
dt.dispose();
}
}
public Class2(byref DataTable dTable)
{
this.dataTable = dTable;
}
那么,现在如果我说Class1 obj1 = Function1();
我obj1.dataTable
会被处置吗?或者它会有适当的数据?