samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Client/ApiClient.cs
/// <summary>
/// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
/// If parameter is a list, join the list with ",".
/// Otherwise just return the string.
/// </summary>
/// <param name="obj">The parameter (header, path, query, form).</param>
/// <returns>Formatted string.</returns>
If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
If parameter is a list, join the list with ",".
Otherwise just return the string.
If parameter is DateTime output in a formatted string ( default ISO 8601 ) customizable with Configuration . DateTime . If parameter is a list join the list with " " . Otherwise just return the string .
public string ParameterToString(object obj)
        {
            if (obj is DateTime)
                return ((DateTime)obj).ToString (Configuration.DateTimeFormat);
            else if (obj is IList)
            {
                string flattenString = "";
                string separator = ",";
                foreach (var param in (IList)obj)
                {
                    flattenString += param.ToString() + separator;
                }
                return flattenString.Remove(flattenString.Length - 1);;
            }
            else
                return Convert.ToString (obj);
        }
public string ParameterToString ( object obj ) { if ( obj is DateTime ) return ( ( DateTime ) obj ) . ToString ( Configuration . DateTimeFormat ) ; else if ( obj is IList ) { string flattenString = " " ; string separator = " " ; foreach ( var param in ( IList ) obj ) { flattenString += param . ToString ( ) + separator ; } return flattenString . Remove ( flattenString . Length - 1 ) ; ; } else return Convert . ToString ( obj ) ; }
If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
If parameter is DateTime output in a formatted string ( default ISO 8601 ) customizable with Configuration . DateTime .
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o") // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 // For example: 2009-06-15T13:45:30.0000000
None
obj
object
The parameter (header, path, query, form).
The parameter ( header path query form ) .