我熟悉使用 out 传递一个简单的数据类型进行操作,但我似乎无法弄清楚如何传递这个 Queue<>
而不会导致编译错误。有什么想法吗?
代码:
Queue<SqlCommand> insertScriptQueue = new Queue<SqlCommand>();
private void UpdateDefaultIndicator(int newDefaultViewID,
out (Queue<SqlCommand>) insertScriptQueue)
UpdateDefaultIndicator(newViewID, out (Queue<SqlCommand>)insertScriptQueue);
最佳答案
您正在传递引用类型。无需用完。
关于c# - out 函数参数的棘手 C# 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1610122/