Stringify.Library/StringConverter.cs
/// <summary>
/// Convert a given type to string
/// </summary>
/// <typeparam name="T">Type of input</typeparam>
/// <param name="value">Instance of input type</param>
/// <param name="options">Converter options to customise</param>
/// <returns>String</returns>
Convert a given type to string
Convert a given type to string
public string ConvertFrom<T>(T value, ConverterOptions options)
        {
            if (value == null)
                return null;
            if (options == null)
                options = ConverterOptions.Default;
            var type = value.GetType();
            if (!EnumerableHelper.IsEnumerableType(type))
                return Convert(value, options);
            return InvokeAsString(type, value, options) as string;
        }
public string ConvertFrom < T > ( T value , ConverterOptions options ) { if ( value == null ) return null ; if ( options == null ) options = ConverterOptions . Default ; var type = value . GetType ( ) ; if ( ! EnumerableHelper . IsEnumerableType ( type ) ) return Convert ( value , options ) ; return InvokeAsString ( type , value , options ) as string ; }
Convert a given type to string
Convert a given type to string
None
value
T
Instance of input type
Instance of input type
options
ConverterOptions
Converter options to customise
Converter options to customise
typeparam
Type of input
Type of input