As others have pointed out, using an if
statement is far more idiomatic here.
But to answer what you ask, you can use lambdas and delegates:
// Bad code, do not use:
(officeDict.ContainsKey("0") ? (Action)(() => { }) : () => officeDict.Add("0", ""))();