c# - c#中如何获取当前执行方法的输出参数列表?

标签 c# reflection out-parameters

我卡住了,假设我有一个方法:

public void InsertEmployee(Employee _employee, out Guid _employeeId)
{
    //My code
    //Current execution is here. 
    //And here I need a list of 'out' parameters of 'InsertEmployee' Method
}

如何实现?我知道的一种方式

 MethodInfo.GetCurrentMethod().GetParameters()

但是如何更具体地只针对输出参数呢?

最佳答案

MethodInfo.GetCurrentMethod().GetParameters().Where(p => p.IsOut)

关于c# - c#中如何获取当前执行方法的输出参数列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21506403/

相关文章:

C# MVC 获取表单数据作为 URL 参数

java - 使用反射设置字段值

c# - Visual Studio 是否优化传递引用?

c# - c#中的线程?

java - 如何等待反射线程完成

C# Mono - 属性名称

vb6 - 最佳实践 : Out parameters vs complex return types in methods

javascript - 如何最好地在 JavaScript 中实现输出参数?

c# - 可以返回字符或字符串的 c# 方法的返回值或输出参数?

c# - 如何在WPF中绘制一个可点击的矩形