첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
#region Nullable 타입 여부 구하기 - IsNullable(type)

/// <summary>
/// Nullable 타입 여부 구하기
/// </summary>
/// <param name="type">타입</param>
/// <returns>Nullable 타입 여부</returns>
public bool IsNullable(Type type)
{
    return !type.IsValueType || Nullable.GetUnderlyingType(type) != null;
}

#endregion
#region Nullable 타입 여부 구하기 - IsNullable(propertyInfo)

/// <summary>
/// Nullable 타입 여부 구하기
/// </summary>
/// <param name="propertyInfo">속성 정보</param>
/// <returns>Nullable 타입 여부</returns>
public bool IsNullable(PropertyInfo propertyInfo)
{
    return IsNullable(propertyInfo.PropertyType);
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요