小弟书读的浅,没见过这种语法,哪位知道的麻烦讲解一下。
        public static DateTime? StringTimeConvertDateTimeHasNull(string time, TimeFormatPatternType type)
         {
             if (string.IsNullOrEmpty(time))
                 return null;
             return StringTimeConvertDateTime(time, type);
         }

解决方案 »

  1.   

    DateTime?是一种类型,同DateTime的一个区别就是它可以为null,所以称为可空类型。
      

  2.   

    http://www.cnblogs.com/pursue/archive/2009/09/21/1570720.html
      

  3.   

    可空类型
    http://msdn.microsoft.com/zh-cn/library/1t3y8s4s(v=vs.80).aspx
      

  4.   

     DateTime 是值类型,作为返回值,不能返回NULL
    DateTime? 就可以返回NULL了,可空类型
      

  5.   

    语法糖,T? 等价 Nullable<T>
      

  6.   

    一般用于数据库返回可空字段,且为简单类型。比如int double,像string可以为null的就不需要了。