コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【C#】Type が nullable なら true を返す拡張メソッド

ソースコード

public static class TypeExtensionMethods
{
    public static bool IsNullable( this Type self )
    {
        return Nullable.GetUnderlyingType( self ) != null;
    }
}