You can work something out using lambda’s, but it will not be a clean syntax:
return (chkStatus
? (Func<object>)(() => {
DoLog(cmd.CommandText);
return obj;
})
: () => null)();
1
solved C# Expressional if statements, possible expansion? [closed]