private int GetSize(TAbstractBase thriftBase) { using (var memoryTransport = new InMemoryTransport()) { thriftBase.WriteAsync(this.protocolFactory.GetProtocol(memoryTransport), CancellationToken.None).GetAwaiter().GetResult(); return(memoryTransport.GetBuffer().Length); } }
private async Task <int> GetSize(TAbstractBase thriftBase) { using (var memoryTransport = new InMemoryTransport()) { await thriftBase.WriteAsync(this.protocolFactory.GetProtocol(memoryTransport), CancellationToken.None).ConfigureAwait(false); return(memoryTransport.GetBuffer().Length); } }