private static async Task WriteMap(short id, Dictionary <string, string> dic) { await _thrift.WriteFieldBeginAsync(new TField(null, TType.Map, id), System.Threading.CancellationToken.None); await _thrift.WriteMapBeginAsync(new TMap(TType.String, TType.String, dic.Count), System.Threading.CancellationToken.None); foreach (var item in dic) { await _thrift.WriteStringAsync(item.Key, System.Threading.CancellationToken.None); await _thrift.WriteStringAsync(item.Value, System.Threading.CancellationToken.None); } await _thrift.WriteMapEndAsync(System.Threading.CancellationToken.None); await _thrift.WriteFieldEndAsync(System.Threading.CancellationToken.None); }