C# 基础使用技巧

1:?操作符

控件赋值常有如下情景设置

如果变量值不为Null,则需要将控件设定为变量的值

可以采用如下方法简写:

this.txtEmail.Text = user.Email?.ToString();

原文地址:https://www.cnblogs.com/volts0302/p/7090425.html