Getting the type of a parameter passed by value via reflection is simple; however, if the parameter is a ref or out, the story's a bit different. For example, a ref or outDateTime parameter's type is actually DateTime&, which is not the same as DateTime and type equality comparisons will fail. Luckily for us, the solution is easy.
Instead of calling ParameterInfo.ParameterType, you need to call ParameterInfo.GetElementType(). Type also has a HasElementType property that indicates wheether you need to call GetElementType().
public static Type GetParameterType(ParameterInfo paramInfo) { if (paramInfo.ParameterType.HasElementType) { return paramInfo.ParameterType.GetElementType(); } else { return paramInfo.ParameterType; } }