RestImageResize/Utils/SmartConvert.cs
/// <summary>
/// Gets the null value of specified type.
/// </summary>
/// <param name="targetType">The target type</param>
/// <returns>
/// The null value for classes and default values for structures.
/// </returns>
Gets the null value of specified type.
Gets the null value of specified type .
private static object GetNullValue(Type targetType)
        {
            if (targetType.IsClass || Nullable.GetUnderlyingType(targetType) != null)
            {
                return null; 
            }
            return Activator.CreateInstance(targetType); 
        }
private static object GetNullValue ( Type targetType ) { if ( targetType . IsClass || Nullable . GetUnderlyingType ( targetType ) != null ) { return null ; } return Activator . CreateInstance ( targetType ) ; }
Gets the null value of specified type.
Gets the null value of specified type .
// Default value for nullable type. // Default value for not nullable struct.
The null value for classes and default values for structures.
The null value for classes and default values for structures .
targetType
Type
The target type
The target type