private int GetSize(TAbstractBase thriftBase)
 {
     using (var memoryTransport = new InMemoryTransport())
     {
         thriftBase.WriteAsync(this.protocolFactory.GetProtocol(memoryTransport), CancellationToken.None).GetAwaiter().GetResult();
         return(memoryTransport.GetBuffer().Length);
     }
 }
示例#2
0
        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);
            }
        }