Nullable GUID

后端 未结 10 2108
北荒
北荒 2020-12-15 04:36

In my database, in one of the table I have a GUID column with allow nulls. I have a method with a Guid? parameter that inserts a new data row in the table. However when I s

10条回答
  •  醉梦人生
    2020-12-15 05:03

    or:

        internal static T CastTo(object value)
        {
            return value != DBNull.Value ? (T)value : default(T);
        }
    

提交回复
热议问题