小编Err*_*ain的帖子

是否有一种简写方法来返回可能为null的值?

如何编写以下方案的简写?

get
{
    if (_rows == null)
    {
        _rows = new List<Row>();
    }

    return _rows;
}
Run Code Online (Sandbox Code Playgroud)

c# null-coalescing-operator null-coalescing

61
推荐指数
8
解决办法
4602
查看次数