I tried to figure it out but I don't get a clue on either how to pass a result of a new instance of a class to a function call or if this is even possible.
If I wan't to pass a random number, I'll have to create it first:
int n = 0;
Random rnd = New Random();
int m = rnd.Next(0, n);
MyClass.MyFunction(MyValue1, m);
Actually, this is 4 lines of code. However, as a newbie to c# I've already seen a lot and want to know, if there is a shorter version of this. Some pseudo code:
MyClass.MyFunction(MyValue1, Random rnd = new Random() {rnd.Next(0, n); return});
Is this somehow possible? I thought I have seen something like this but can't find anything about it.