Best syntax for a = (x == null) ? null : x.func()

后端 未结 7 826
囚心锁ツ
囚心锁ツ 2020-12-24 04:50

Basic question here - I have many lines of code that look something like:

var a = (long_expression == null) ? null : long_expression.Method();
7条回答
提交回复
热议问题