private void AppendList(StringBuilder sb, object value, EntityDataType dataType) { if (value == null) { return; } var enumerable = value as IEnumerable; if (enumerable == null) { throw new ApiException("Expected parameter to the IN filter to be a collection"); } bool hadOne = false; foreach (object element in enumerable) { string serialized = ApiUtils.Serialize(element, dataType) ?? ""; if (serialized.IndexOf('\'') != -1 || serialized.IndexOf(',') != -1) { serialized = "'" + serialized.Replace("'", "''") + "'"; } if (hadOne) { sb.Append(','); } else { hadOne = true; } sb.Append(Uri.EscapeDataString(serialized)); } }
private void Append(StringBuilder sb, object value, EntityDataType dataType) { sb.Append(Uri.EscapeDataString(ApiUtils.Serialize(value, dataType))); }