GetValueOrDefault获取值,如果为空返回值类型默认值。int? Number =null;int t= Number.GetValueOrDefault(); HasValue可以判断是否有值bool have = Number.HasValue;
这篇文档对您是否有帮助?