Possible duplicate:How to check if an object is null?
I have a System.Type object that can be Nullable<T>. How can I detect this at runtime?
Nullable<T>
Note: At this point, I don't care what T is, I just need to know if it is Nullable.
Possible duplicate:
How to check if an object is valid?
if not..
bool IsNullableType(Type theType) { return (theType.IsGenericType && theType.GetGenericTypeDefinition().Equals(typeof(Nullable<>))); }
Source: https://habr.com/ru/post/1779967/More articles:C # How to convert irregular date and time String to DateTime? - c #error C3646: "closure": unknown override specifier - c ++Mysql replication stops without errors - mysqlhints codeigniter n tricks - phpC # How to get specific text located inside a string? - stringWhy can't I use the LESS CSS workspace? - cssin tcl cannot read a variable when its name consists of another variable - variablesДинамическое изменение вида внутреннего вида в Android - androidText compression for HTTP with POST parameters - httpGenerate code snippet for functions in VS2010 - c #All Articles