When you put a pair of parentheses after an expression, you are telling the C# compiler that you would like it to invoke a method. Hence the "used like a 'method'" error.
If you are looking to obtain a random byte
, you can do it like this:
byte kort = (byte)KortNummer.Next(1, 11);
This calls the Next
method on the KortNummer
variable, producing a number from 1 to 11.