我在调用我所做的方法时遇到问题。输出参数时出错
的方法我打电话来是folows
public bool GetValue(string column, out object result)
{
result = null;
// values is a Dictionary<string, object>
if (this._values.ContainsKey(column))
{
result = Convert.ChangeType(this._values[column], result.GetType());
return true;
}
return false;
}
我caling方法与此代码,但我得到一个编译器错误
int age;
a.GetValue("age", out age as object)
ref或out参数必须是一个可分配的变量
是否有其他人有这个问题,或者我只是做有什么问题?
+1的确是一个很好的问题 – V4Vendetta