public byte[] Call(ICallData data) { var result = _serverApiService.InvokeServerCommand(_commandName, data.GetBytes()) .GetAwaiter() .GetResult(); switch (result.Result) { case ServerCommandResult.Success: return(result.Data); case ServerCommandResult.Error: throw TransportClient.ReadException(result.Data); default: throw new InvalidOperationException("Unable to deserialize server command response"); } }