标签: null-cast

哪个更受欢迎:new Nullable <int>或(int?)null?

在这样的表达式中首选哪种方式:

int? Id
{
   get
   {
      int i;
      return Int32.TryParse(Request["id"], out i) ? i : (int?)null;
   }
}
Run Code Online (Sandbox Code Playgroud)

是否更好地施放null或创造new Nullable<T>

.net c# casting nullable null-cast

12
推荐指数
3
解决办法
4116
查看次数

标签 统计

.net ×1

c# ×1

casting ×1

null-cast ×1

nullable ×1