public static string WriteQuotedStringMap(SqlMap<string, string> m, string map_item_delim = ",", string map_kv_delim = ":") { return "\"" + string.Join(map_item_delim, from p in m select string.Format("{0}{1}{2}", p.Key, map_kv_delim, p.Value)) + "\""; }
// void WriteValue(object val, StreamWriter writer) // // Helper function that takes a value val and writes it into the output stream. It will convert the value to a string serialization. private void WriteValue(object val, StreamWriter writer) { if (val is SqlMap <string, string> ) { writer.Write(DriverFunctions.WriteQuotedStringMap(val as SqlMap <string, string>, this._map_item_delim, this._map_kv_delim)); } else if (val is SqlArray <int> ) { writer.Write(DriverFunctions.WriteQuotedIntArray(val as SqlArray <int>, this._array_item_delim)); } else if (val is string) { writer.Write(DriverFunctions.AddQuotes(val as string)); } else { writer.Write(val); } }