Have an Action delegate and trying to use the ternary operator inside of it with lambdas:
Action<string> action = new Action<string>( str => (str == null) ?
Console.WriteLine("isnull") : Console.WriteLine("isnotnull")
Gives the old “only assignment, decrement, etc. allowed” error.
Is this possible somehow?
You would have to do it like this: