convert value type to nullable type
Published: 23. November 2011 | Updated: 23. November 2011License: Microsoft Public License (MS-PL)
Categories: Framework » Reflection
Tags: C# Reflection
public static Type ConvertToNullable(Type type) { if (type.IsValueType) return typeof(Nullable<>).MakeGenericType(type); return type; }
| Send us feedback about this snippet » |





