Is Nullable Type - CSharp System.Reflection

CSharp examples for System.Reflection:Type

Description

Is Nullable Type

Demo Code

//Copyright (C) Microsoft Corporation.  All rights reserved.
using System.Threading;
using System.Reflection.Emit;
using System.Reflection;
using System.Linq.Expressions;
using System.Text;
using System.Collections.Generic;

public class Main{
        static bool IsNullableType(Type type)
        {/*from   ww  w  . ja va  2  s .  c  om*/
            return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>);
        }
}

Related Tutorials