I just wondered, how the exact syntax is for ref and out parameters for delegates and inline lambda functions.
here is an example
if a function is defined as
public void DoSomething(int withValue) { }
a delegate in a function can be created by
public void f()
{
Action<int> f2 = DoSomething;
f2(3);
}
how is that syntax, if the original function would be defined as
public void DoSomething(ref int withValue) { withValue = 3; }
You need to define a new delegate type for this method signature:
The reason why the .NET Framework does not include this type is probably because
refparameters are not very common, and the number of needed types explodes if you add one delegate type for each possible combination.