Correct way to check if a type is Nullable [duplicate]

In order to check if a Type ( propertyType ) is nullable, I’m using:

bool isNullable =  "Nullable`1".Equals(propertyType.Name)

Is there some way that avoid using magic strings ?

2 Answers
2

Leave a Comment