c# - 为什么 (Guid?)null ?? 默认返回空 guid
问题描述
VS 立即窗口的输出
default(Guid?)
=> null
(Guid?)null == default
=> true
(Guid?)null ?? default
=> {00000000-0000-0000-0000-000000000000}
我预计最后一个是null
而不是Guid.Empty
。那么为什么会这样呢?
解决方案
推荐阅读
- matlab - Matlab中的Uicalendar在部署中不起作用
- php - 检查客户是否在 Woocommerce 中为产品撰写评论
- javascript - 使用 ReactJS 分页
- c++ - 不计算一个范围内的完美数字的数量?
- python - 根据给定的概率有效地改变二进制字符串中的字符
- c - 如何在C中递归打印trie中的所有单词
- javascript - 如何定位在 php 中没有任何 ID 或标签的元素的 innerHTML?
- excel - 从 Excel 关闭草图
- regex - 如何使用带有正则表达式的 linux sed 在文本文件中查找和删除长模式
- java - 我的 EditText 仅由 SetText() 更新;每第二次尝试